Layering Multiple JPEG Images
Posted: 2017-01-31T07:31:37-07:00
I want to resize several JPEG images and overlay them on a background image by using Imagemagick.
I can achieve my purpose with the following cords.
But It is written that
"Do not do this with a lossy image format like "JPEG" as the format errors are accumulative, and the base image will quickly degrade."
in a following page.
https://www.imagemagick.org/Usage/layers/#composite
Shouldn't I use the above cord for JPEG images ?
If so, I tried the following codes too.
But the positions of aaa.jpg and bbb.jpg didn't come to the points at (50, 100) and (100, 200).
Maybe, the "-page +50+100" was also affected by "-resize".
I tried the following codes too.
But the positions of aaa.jpg and bbb.jpg came to the point at (0, 0).
If I use the above pattern, that is,
how should I write codes ?
Please help me.
Thank you in advance.
I can achieve my purpose with the following cords.
Code: Select all
convert -size 500x1000 xc:white \
\( aaa.jpg -resize 50x50 \) -geometry +50+100 -composite \
\( bbb.jpg -resize 100x100 \) -geometry +100+200 -composite \
final.jpg"
"Do not do this with a lossy image format like "JPEG" as the format errors are accumulative, and the base image will quickly degrade."
in a following page.
https://www.imagemagick.org/Usage/layers/#composite
Shouldn't I use the above cord for JPEG images ?
If so, I tried the following codes too.
Code: Select all
convert -size 500x1000 xc:white \
-page +50+100 \( aaa.jpg -resize 50x50 \) \
-page +100+200 \( bbb.jpg -resize 100x100 \) \
-layers flatten flatten_img.jpg"
Maybe, the "-page +50+100" was also affected by "-resize".
I tried the following codes too.
Code: Select all
convert -size 500x1000 xc:white \
-page +50+100 \( aaa.jpg -resize 50x50 +repage \) \
-page +100+200 \( bbb.jpg -resize 100x100 +repage \) \
-layers flatten flatten_img.jpg"
If I use the above pattern, that is,
Code: Select all
convert ..... -page ..... -flatten
Please help me.
Thank you in advance.