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

Blendmodes #515

Merged
merged 11 commits into from
Aug 9, 2018
Merged

Blendmodes #515

merged 11 commits into from
Aug 9, 2018

Conversation

hipstersmoothie
Copy link
Collaborator

@hipstersmoothie hipstersmoothie commented Aug 6, 2018

What's Changing and Why

Allows users to composite image in different ways similar to gimp.

closes #139
copied code from #191

What else might be affected

Nothing.

Tasks

  • Add tests
  • Update Documentation
  • Update jimp.d.ts

@hipstersmoothie hipstersmoothie added the enhancement a request for a new feature or change in behavior label Aug 6, 2018
@@ -422,44 +430,70 @@ export function composite(src, x, y, cb) {
return throwError.call(this, 'x and y must be numbers', cb);
}

let { mode, opacitySource, opacityDest } = options;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you add a test with these new params ?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

test added! it's only 1 can be more thorough if needed

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would prefer to have a test that will expect the whole image to be equal to a base image so that we have more certainty that it will break fast if the code is wrong (like you've done in : https://github.com/oliver-moran/jimp/pull/524/files#diff-c632bfb61a4e129216f938dcb8d1a782R126)

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@edi9999 I added a better test but for some reason my bitmaps were always off by 1 before writing. The new test writes to the filesystem and checks those buffers.

@edi9999 edi9999 merged commit 5294ae9 into jimp-dev:master Aug 9, 2018
@hipstersmoothie hipstersmoothie deleted the blendmodes branch August 9, 2018 07:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement a request for a new feature or change in behavior
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Blend mode argument for composite()
2 participants