Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add blit (copy) functionality #15

Merged
merged 1 commit into from
Apr 8, 2015
Merged

Add blit (copy) functionality #15

merged 1 commit into from
Apr 8, 2015

Conversation

gcq
Copy link
Contributor

@gcq gcq commented Mar 22, 2015

Also adds a function that returns the index of the pixel in the bitmap given its coordinates

var lenna = new Jimp("lenna.png", function(){
    this.blit(this, 247, 235, 98, 136, 0, 0)
    .write("lennatest.png");
});

The snippet above copies lenna's face to 0,0 and writes that file.

I've not tested this in much depth, but from what i've seen, corner cases or out of bounds modifications don't break the lib. I'm all for sanity checks though if you want them.

Also adds a function that returns the index of the pixel in the bitmap
given its coordinates
oliver-moran added a commit that referenced this pull request Apr 8, 2015
Add blit (copy) functionality
@oliver-moran oliver-moran merged commit 70372e8 into jimp-dev:master Apr 8, 2015
@oliver-moran
Copy link
Collaborator

Thanks, GCQ.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants