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

OverlayWith JPEG input, JPEG output #376

Closed
rahbari opened this issue Mar 12, 2016 · 5 comments
Closed

OverlayWith JPEG input, JPEG output #376

rahbari opened this issue Mar 12, 2016 · 5 comments
Labels

Comments

@rahbari
Copy link

rahbari commented Mar 12, 2016

When OverlatWith is used on a jpeg input and the output is jpeg as well the produced image is weird:

sharp('test.jpg').overlayWith('overlay.png').jpeg().pipe(res);

download

When input is png and output is jpeg or when input is jpeg and the output is png or webp the result image is ok. This happens on both Windows and OSX, I haven't tested linux yet. My vips version is 8.2.2 on mac.

@lovell
Copy link
Owner

lovell commented Mar 12, 2016

Hello, the forthcoming v0.14.0 will contain many improvements to the overlayWith feature, including support for 16-bit PNGs (which is what this example looks like). Are you able to test with the needle branch?

npm install lovell/sharp#needle

https://github.com/lovell/sharp/blob/needle/docs/api.md#overlaywithimage-options

@lovell
Copy link
Owner

lovell commented Mar 12, 2016

See #239

@rahbari
Copy link
Author

rahbari commented Mar 12, 2016

Hello lovell, thank you for this great library.
I used photoshop "save for web" to create the overlay file. I tested 24bit PNG as well as 8bit png. In both case output is corrupted. This happens only when the source file is jpeg and the output is jpeg as well. I will test the needle branch now and update asap!

@rahbari
Copy link
Author

rahbari commented Mar 12, 2016

The needle branch works ok with the same files! thank you so much lovell. when this branch is released?

@lovell
Copy link
Owner

lovell commented Mar 12, 2016

Great, glad to hear v0.14.0 will solve this problem, thanks for confirming. Please subscribe to #239 for release updates.

@lovell lovell closed this as completed Mar 12, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants