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

Overlap One Image over Another #15

Closed
mozgbrasil opened this issue Sep 21, 2021 · 10 comments
Closed

Overlap One Image over Another #15

mozgbrasil opened this issue Sep 21, 2021 · 10 comments
Assignees

Comments

@mozgbrasil
Copy link

Good afternoon my friends

I have the following imagemagick command to overlay images

 composite -gravity Center image_resize.png canvas.png image.png

When I try the following way using its container, it returns an empty image

docker run -v ~/Imagens:/imgs dpokidov/imagemagick \
-composite -gravity Center /imgs/image_resize.png /imgs/canvas.png /imgs/$(date +%Y-%m-%d_%H-%M-%S)_image.png

Thank you in advance if you can help

@dooman87
Copy link
Owner

Hey,

Thanks for creating this. Could you please share the image, so I can reproduce and show the version of the local IM (composite --version)?

@dooman87 dooman87 self-assigned this Sep 22, 2021
@mozgbrasil
Copy link
Author

@dooman87
Copy link
Owner

I think -composite flag is different from composite entrypoint. The below worked for me:

docker run -v $(pwd):/imgs --entrypoint=composite dpokidov/imagemagick -gravity Center /imgs/image_resize.png /imgs/canvas.png /imgs/out.png

@mozgbrasil
Copy link
Author

I just installed imagemagick and run the following command

composite -gravity Center image_resize.png canvas.png image.png

Which returned the expected result

Using the container the image is returned with error in the case in black and white

Captura de tela de 2021-09-22 09-45-10

@dooman87
Copy link
Owner

Looks like an IM bug to me. Just to make sure could you please post composite -version output here?

@mozgbrasil
Copy link
Author

$ composite --version
Version: ImageMagick 6.9.10-23 Q16 x86_64 20190101 https://imagemagick.org
Copyright: © 1999-2019 ImageMagick Studio LLC
License: https://imagemagick.org/script/license.php
Features: Cipher DPC Modules OpenMP 
Delegates (built-in): bzlib djvu fftw fontconfig freetype heic jbig jng jp2 jpeg lcms lqr ltdl lzma openexr pangocairo png tiff webp wmf x xml zlib

@dooman87
Copy link
Owner

Yup, so it seems like an IM bug. I tested it on version 7.0.7-2 and it's working as expected:

docker run -v $(pwd):/imgs --entrypoint=composite dpokidov/imagemagick:7.0.7-2 -gravity Center /imgs/image_resize.png /imgs/canvas.png /imgs/out.png

@mozgbrasil
Copy link
Author

Thank you my friend

@dooman87
Copy link
Owner

I've also opened an issue in IM - ImageMagick/ImageMagick#4271

@dooman87
Copy link
Owner

And it turned out that the latest version of IM needs an extra -colorspace -sRGB to make it work.

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

No branches or pull requests

2 participants