I have these images in a folder:
089.GIF
090.GIF
091.GIF
092.GIF
093.GIF
094.GIF
095.GIF
096.GIF
097.GIF
098.GIF
099.GIF
100.GIF
101.GIF
102.GIF
102_2.GIF
103.GIF
105.GIF
106.GIF
and want to apply this as a background to all of them (as straightforward as possible):
background.png
Thanks in advance for any ideas.
Append background to all images ?
Append background to all images ?
Version: ImageMagick-7.0.7-28-Q16-x64-static http://www.imagemagick.org
Copyright: Copyright (C) 1999-2018 ImageMagick Studio LLC
Copyright: Copyright (C) 1999-2018 ImageMagick Studio LLC
- fmw42
- Posts: 25562
- Joined: 2007-07-02T17:14:51-07:00
- Authentication code: 1152
- Location: Sunnyvale, California, USA
Re: Append background to all images ?
What platform?
Are the foreground images transparent? Are they the same size as the background image?
The simplest way is to use mogrify to put the background image under the other images.
see
http://www.imagemagick.org/Usage/basics/#mogrify
http://www.imagemagick.org/Usage/basics ... fy_compose
Are the foreground images transparent? Are they the same size as the background image?
The simplest way is to use mogrify to put the background image under the other images.
see
http://www.imagemagick.org/Usage/basics/#mogrify
http://www.imagemagick.org/Usage/basics ... fy_compose
Re: Append background to all images ?
Could you provide an example perhaps ?fmw42 wrote:What platform?
Windows
Are the foreground images transparent? Are they the same size as the background image?
yes and yes
The simplest way is to use mogrify to put the background image under the other images.
see
http://www.imagemagick.org/Usage/basics/#mogrify
http://www.imagemagick.org/Usage/basics ... fy_compose
I already tried, but the resulting script always fails horribly...
Version: ImageMagick-7.0.7-28-Q16-x64-static http://www.imagemagick.org
Copyright: Copyright (C) 1999-2018 ImageMagick Studio LLC
Copyright: Copyright (C) 1999-2018 ImageMagick Studio LLC
- fmw42
- Posts: 25562
- Joined: 2007-07-02T17:14:51-07:00
- Authentication code: 1152
- Location: Sunnyvale, California, USA
Re: Append background to all images ?
Please upload 2 or 3 of your images and your background image to some free hosting service such as dropbox.com and put the URLs here. We need to see your images to know exactly what you are trying to do and if there are any issues with the images.
Note mogrify needs to have all your images placed in that folder. Then cd to the folder and use mogrify as described in those examples. However, I would suggest that you create a new directory for the output, so that you do not lose your original data.
Note mogrify needs to have all your images placed in that folder. Then cd to the folder and use mogrify as described in those examples. However, I would suggest that you create a new directory for the output, so that you do not lose your original data.
Re: Append background to all images ?
Here you go:
https://dl.dropboxusercontent.com/u/145 ... _z/089.GIF
https://dl.dropboxusercontent.com/u/145 ... _z/090.GIF
https://dl.dropboxusercontent.com/u/145 ... _z/091.GIF
https://dl.dropboxusercontent.com/u/145 ... _z/092.GIF
https://dl.dropboxusercontent.com/u/145 ... _z/093.GIF
https://dl.dropboxusercontent.com/u/145 ... _z/094.GIF
https://dl.dropboxusercontent.com/u/145 ... _z/095.GIF
https://dl.dropboxusercontent.com/u/145 ... _z/096.GIF
https://dl.dropboxusercontent.com/u/145 ... _z/097.GIF
https://dl.dropboxusercontent.com/u/145 ... _z/098.GIF
https://dl.dropboxusercontent.com/u/145 ... _z/099.GIF
https://dl.dropboxusercontent.com/u/145 ... _z/100.GIF
https://dl.dropboxusercontent.com/u/145 ... _z/101.GIF
https://dl.dropboxusercontent.com/u/145 ... _z/102.GIF
https://dl.dropboxusercontent.com/u/145 ... /102_2.GIF
https://dl.dropboxusercontent.com/u/145 ... _z/103.GIF
https://dl.dropboxusercontent.com/u/145 ... _z/105.GIF
https://dl.dropboxusercontent.com/u/145 ... _z/106.GIF
https://dl.dropboxusercontent.com/u/145 ... ground.png
https://dl.dropboxusercontent.com/u/145 ... _z/089.GIF
https://dl.dropboxusercontent.com/u/145 ... _z/090.GIF
https://dl.dropboxusercontent.com/u/145 ... _z/091.GIF
https://dl.dropboxusercontent.com/u/145 ... _z/092.GIF
https://dl.dropboxusercontent.com/u/145 ... _z/093.GIF
https://dl.dropboxusercontent.com/u/145 ... _z/094.GIF
https://dl.dropboxusercontent.com/u/145 ... _z/095.GIF
https://dl.dropboxusercontent.com/u/145 ... _z/096.GIF
https://dl.dropboxusercontent.com/u/145 ... _z/097.GIF
https://dl.dropboxusercontent.com/u/145 ... _z/098.GIF
https://dl.dropboxusercontent.com/u/145 ... _z/099.GIF
https://dl.dropboxusercontent.com/u/145 ... _z/100.GIF
https://dl.dropboxusercontent.com/u/145 ... _z/101.GIF
https://dl.dropboxusercontent.com/u/145 ... _z/102.GIF
https://dl.dropboxusercontent.com/u/145 ... /102_2.GIF
https://dl.dropboxusercontent.com/u/145 ... _z/103.GIF
https://dl.dropboxusercontent.com/u/145 ... _z/105.GIF
https://dl.dropboxusercontent.com/u/145 ... _z/106.GIF
https://dl.dropboxusercontent.com/u/145 ... ground.png
Version: ImageMagick-7.0.7-28-Q16-x64-static http://www.imagemagick.org
Copyright: Copyright (C) 1999-2018 ImageMagick Studio LLC
Copyright: Copyright (C) 1999-2018 ImageMagick Studio LLC
- fmw42
- Posts: 25562
- Joined: 2007-07-02T17:14:51-07:00
- Authentication code: 1152
- Location: Sunnyvale, California, USA
Re: Append background to all images ?
Your background image is surrounded by black and your other images have only transparency and black areas. So any overlay of the two will not show the black areas on the black part of the background. So I am reversing the black areas in the input images to white areas with transparency. Then the following command does the composition on all files using mogrify.
# On my desktop I created two folders, test1 and test2.
# I put 3 of your images into folder test1.
# test2 is going to be where the output images are placed.
# I put your background image on the desktop, not in either folder.
# I run the following to cd to test1 folder and then use mogrify to process all the files in test1 with the background image on the desktop
# On my desktop I created two folders, test1 and test2.
# I put 3 of your images into folder test1.
# test2 is going to be where the output images are placed.
# I put your background image on the desktop, not in either folder.
# I run the following to cd to test1 folder and then use mogrify to process all the files in test1 with the background image on the desktop
Code: Select all
cd desktop/test1
mogrify -path ../test2 -format png -alpha off -negate -alpha on -draw 'image DstOver 0,0 0,0 "../background.png"' *.GIF
Re: Append background to all images ?
Hmm... when I use your commands I get this:
https://dl.dropboxusercontent.com/u/145 ... 00_096.png
https://dl.dropboxusercontent.com/u/145 ... 00_097.png
https://dl.dropboxusercontent.com/u/145 ... 00_089.png
The image(s) created look like thisC:\Users\Pascal\Desktop\close_z>append.bat
C:\Users\Pascal\Desktop\close_z>cd C:\Users\Pascal\Desktop\close_z
C:\Users\Pascal\Desktop\close_z>mogrify -path ../test2 -format png -alpha off -n
egate -alpha on -draw 'image DstOver 0,0 0,0 "../background.png"' *.GIF
mogrify.exe: unable to open image `DstOver': No such file or directory @ error/b
lob.c/OpenBlob/2641.
mogrify.exe: unable to open file `DstOver' @ error/png.c/ReadPNGImage/3759.
mogrify.exe: unable to open image `0,0': No such file or directory @ error/blob.
c/OpenBlob/2641.
mogrify.exe: unable to open file `0,0' @ error/png.c/ReadPNGImage/3759.
mogrify.exe: unable to open image `0,0': No such file or directory @ error/blob.
c/OpenBlob/2641.
mogrify.exe: unable to open file `0,0' @ error/png.c/ReadPNGImage/3759.
mogrify.exe: unable to open image `../background.png'': No such file or director
y @ error/blob.c/OpenBlob/2641.
mogrify.exe: unable to open module file `C:\Program Files\ImageMagick-6.8.3-Q16\
modules\coders\IM_MOD_RL_PNG'_.dll': No such file or directory @ warning/module.
c/GetMagickModulePath/683.
mogrify.exe: no decode delegate for this image format `../background.png'' @ err
or/constitute.c/ReadImage/550.
mogrify.exe: Non-conforming drawing primitive definition `image' @ error/draw.c/
DrawImage/3154.
C:\Users\Pascal\Desktop\close_z>
https://dl.dropboxusercontent.com/u/145 ... 00_096.png
https://dl.dropboxusercontent.com/u/145 ... 00_097.png
https://dl.dropboxusercontent.com/u/145 ... 00_089.png
Version: ImageMagick-7.0.7-28-Q16-x64-static http://www.imagemagick.org
Copyright: Copyright (C) 1999-2018 ImageMagick Studio LLC
Copyright: Copyright (C) 1999-2018 ImageMagick Studio LLC
- fmw42
- Posts: 25562
- Joined: 2007-07-02T17:14:51-07:00
- Authentication code: 1152
- Location: Sunnyvale, California, USA
Re: Append background to all images ?
You have to use windows path syntax if running on Windows, I would expect. But I am not Window user, so this would need confirmation from one of the Windows users. see http://www.imagemagick.org/Usage/windows/
-
- Posts: 12159
- Joined: 2010-01-23T23:01:33-07:00
- Authentication code: 1151
- Location: England, UK
Re: Append background to all images ?
Without testing, I think this is a quoting issue. For Windows, swap the use of double/single quotes.
snibgo's IM pages: im.snibgo.com