Stitching image on given canvas size ? [SOLVED]
Re: Stitching image on given canvas size using ImageMagic ?
If I type:
"c:\program files\imageMagick-6.8.3-Q16\identify" -version
It outputs:
Versin: ImageMagick 6.8.3-6 2013-02-26 Q16 http://www.imagemagick.org
Features: DPC OpenMP
Delegates: bzlib fontconfig freetype jng jp2 jpeg lcms lzma pango png ps tiff x xml zlib
"c:\program files\imageMagick-6.8.3-Q16\identify" -version
It outputs:
Versin: ImageMagick 6.8.3-6 2013-02-26 Q16 http://www.imagemagick.org
Features: DPC OpenMP
Delegates: bzlib fontconfig freetype jng jp2 jpeg lcms lzma pango png ps tiff x xml zlib
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
-
- Posts: 12159
- Joined: 2010-01-23T23:01:33-07:00
- Authentication code: 1151
- Location: England, UK
Re: Stitching image on given canvas size using ImageMagic ?
That directory can be added to your path, so programs there will be found without having to give their location every time. Type:
This adds the directory to the path for this command window only. Try the commands and script now.
To make the change system-wide: Control panel, System, Advanced, Evironment variables, System variables. Or you can reinstall IM and let it do the job for you.
Code: Select all
set PATH=c:\program files\imageMagick-6.8.3-Q16\;%PATH%
To make the change system-wide: Control panel, System, Advanced, Evironment variables, System variables. Or you can reinstall IM and let it do the job for you.
snibgo's IM pages: im.snibgo.com
Re: Stitching image on given canvas size using ImageMagic ?
Ok, after reinstalling it seems to work now.
Is there a way to have that batch script process multiple files at a time ? E.g. all gifs in one folder and output them to another folder, numbered 001 002 etc. ?
Is there a way to have that batch script process multiple files at a time ? E.g. all gifs in one folder and output them to another folder, numbered 001 002 etc. ?
Last edited by Rye on 2013-02-28T14:03:29-07:00, edited 3 times in total.
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
-
- Posts: 12159
- Joined: 2010-01-23T23:01:33-07:00
- Authentication code: 1151
- Location: England, UK
Re: Stitching image on given canvas size using ImageMagic ?
Yes. See any guide on scripting in Windows.
snibgo's IM pages: im.snibgo.com
Re: Stitching image on given canvas size using ImageMagic ?
[deleted]
Last edited by Rye on 2013-03-03T07:02:22-07:00, edited 1 time in total.
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
Re: Stitching image on given canvas size using ImageMagic ?
EDIT: There is a really simple way that all those images have in common:
Their pattern repeats after EXACTLY 128x128 pixels.
Could you please change your script to work for those files only ? That would reslove this problem and this thread could be closed.
Thanks for all you assistance. It was of great help to me !
Their pattern repeats after EXACTLY 128x128 pixels.
Could you please change your script to work for those files only ? That would reslove this problem and this thread could be closed.
Thanks for all you assistance. It was of great help to me !
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
Re: Stitching image on given canvas size using ImageMagic ?
I know got this one working:
However the problem is that I want this script to process 100+ gifs inside the same folder.
If I currently put it in the folder it will only output some croped-X.png's and quit.
It should be able to process each gif after the other.
Ideas ?
Code: Select all
SET /P width=Please enter canvas width:
SET /P heigth=Please enter canvas heigth:
convert *.gif -crop 128x128+0+0 cropped.png
"%IMG%convert" ^
-size %width%x%heigth% ^
tile:cropped.png ^
tiled.png
If I currently put it in the folder it will only output some croped-X.png's and quit.
It should be able to process each gif after the other.
Ideas ?
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: Stitching image on given canvas size using ImageMagic ?
With PNG you need to remove the virtual canvas by adding +repage after the crop.convert *.gif -crop 128x128+0+0 cropped.png
Furthermore you process all the gifs as cropped-xxx.png, but you only use cropped.png in your next command.
I do not believe that you are looping correctly or I do not understand what you are trying to do. Sorry I am not a Windows user, so cannot help much more at this point without further explanation.
Re: Stitching image on given canvas size using ImageMagic ?
I only need 1 cropped.png for the output file.
1 cropped.png -> tiled.png
Well that script aside:
The only thing I try is:
Process input file (001)
- save to outputfile that matches the 001 of the input and add a -output to it
Repeat with 002...
You could say "lets not care about the script at all right now" the only thing that matters is to find a way to process all gifs in the folder and then afterwards have the output correlate to the same number.
Wait a minute now thats an idea... when I processed all those images to lets say... cropped-0.png, cropped-1.png ...
What would I have to do then in order to get the rest working ?
1 cropped.png -> tiled.png
Well that script aside:
The only thing I try is:
Process input file (001)
- save to outputfile that matches the 001 of the input and add a -output to it
Repeat with 002...
You could say "lets not care about the script at all right now" the only thing that matters is to find a way to process all gifs in the folder and then afterwards have the output correlate to the same number.
Wait a minute now thats an idea... when I processed all those images to lets say... cropped-0.png, cropped-1.png ...
What would I have to do then in order to get the rest working ?
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
-
- Posts: 12159
- Joined: 2010-01-23T23:01:33-07:00
- Authentication code: 1151
- Location: England, UK
Re: Stitching image on given canvas size using ImageMagic ?
"convert *.gif" will read all the gifs before processing any of them. Maybe not a great idea.
For looping through files, see Windows "for" command. You could have two converts within the for-loop: one to crop, the second to tile. (Or even do both jobs in one convert.)
For looping through files, see Windows "for" command. You could have two converts within the for-loop: one to crop, the second to tile. (Or even do both jobs in one convert.)
snibgo's IM pages: im.snibgo.com
Re: Stitching image on given canvas size using ImageMagic ?
After some fiddling around I got this far:
The problem now however is that I only have one tiled jpg.
How can I achieve that the tiled will be automatically numbered so I have it like this: 001tiled.jpg 002tiled.jpg..... ?
Code: Select all
for %%X in (*.png) do "%IMG%convert" ^
-size 612x322 ^
tile:%%X ^
tiled.jpg
How can I achieve that the tiled will be automatically numbered so I have it like this: 001tiled.jpg 002tiled.jpg..... ?
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
-
- Posts: 12159
- Joined: 2010-01-23T23:01:33-07:00
- Authentication code: 1151
- Location: England, UK
Re: Stitching image on given canvas size using ImageMagic ?
That would be quite tricky. But you can easily do:
Type "for /?" or "help for" for this and other options.
Code: Select all
for %%X in (*.png) do "%IMG%convert" ^
-size 612x322 ^
tile:%%X ^
%%~nX_tiled.jpg
snibgo's IM pages: im.snibgo.com
Re: Stitching image on given canvas size using ImageMagic ?
ok, that works great !
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
Re: Stitching image on given canvas size using ImageMagic ?
Since this problem is resolved the thread can be closed !
Thank you very much again for your extensive and effective help !
Thank you very much again for your extensive and effective help !
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