Code: Select all
magick.exe yourimage.png -crop 256x256 -set filename:tile "%%[fx:page.x/256]_%%[fx:page.y/256]" +repage +adjoin "tile-%%[filename:tile].png"
Code: Select all
magick.exe yourimage.png -crop 256x256 -set filename:tile "%%[fx:page.x/256]_%%[fx:page.y/256]" +repage +adjoin "tile-%%[filename:tile].png"
snibgo wrote: ↑2017-06-01T20:02:44-07:00 What is the first command that fails? What is the error message?
You should then try that command in the command window. What happens then?
For example, the first IM command seems to be:Substituting the variables, and changing %% to %:Code: Select all
%imagemagick% %filename% -resize 50%% %basename%-500.%extension%
Does that command work? If not what is the error message? If it is "UnableToOpenConfigureFile" then you haven't installed IM properly.Code: Select all
magick my-image.jpg -resize 50% my_image_base_name-500.jpg
Code: Select all
%imagemagick% %filename% -resize 50% %basename%-500.%extension%
magick.exe: unable to open image 'my-image.jpg': No such file or directory @ error/blob.c/OpenBlob/3094.
magick.exe: no image to apply a property "%w" @ warning/property.c/GetMagickPropertyLetter/2561.
magick.exe: unknown image property "%w" @ warning/property.c/InterpretImageProperties/3499.
magick.exe: no image to apply a property "%h" @ warning/property.c/GetMagickPropertyLetter/2449.
magick.exe: unknown image property "%h" @ warning/property.c/InterpretImageProperties/3499.
magick.exe: no image to apply a property "%m" @ warning/property.c/GetMagickPropertyLetter/2480.
magick.exe: unknown image property "%m" @ warning/property.c/InterpretImageProperties/3499.
%imagemagick% %filename% -resize 25% %basename%-250.%extension%
magick.exe: unable to open image 'my-image.jpg': No such file or directory @ error/blob.c/OpenBlob/3094.
magick.exe: no image to apply a property "%w" @ warning/property.c/GetMagickPropertyLetter/2561.
magick.exe: unknown image property "%w" @ warning/property.c/InterpretImageProperties/3499.
magick.exe: no image to apply a property "%h" @ warning/property.c/GetMagickPropertyLetter/2449.
magick.exe: unknown image property "%h" @ warning/property.c/InterpretImageProperties/3499.
magick.exe: no image to apply a property "%m" @ warning/property.c/GetMagickPropertyLetter/2480.
magick.exe: unknown image property "%m" @ warning/property.c/InterpretImageProperties/3499.
%imagemagick% %filename% -resize 12.5% %basename%-125.%extension%
magick.exe: unable to open image 'my-image.jpg': No such file or directory @ error/blob.c/OpenBlob/3094.
magick.exe: no image to apply a property "%w" @ warning/property.c/GetMagickPropertyLetter/2561.
magick.exe: unknown image property "%w" @ warning/property.c/InterpretImageProperties/3499.
magick.exe: no image to apply a property "%h" @ warning/property.c/GetMagickPropertyLetter/2449.
magick.exe: unknown image property "%h" @ warning/property.c/InterpretImageProperties/3499.
magick.exe: no image to apply a property "%m" @ warning/property.c/GetMagickPropertyLetter/2480.
magick.exe: unknown image property "%m" @ warning/property.c/InterpretImageProperties/3499.
This is the input image for the process. So, does that file exist?unable to open image 'my-image.jpg'
snibgo wrote: ↑2017-06-01T20:02:44-07:00 What is the first command that fails? What is the error message?
You should then try that command in the command window. What happens then?
For example, the first IM command seems to be:Substituting the variables, and changing %% to %:Code: Select all
%imagemagick% %filename% -resize 50%% %basename%-500.%extension%
Does that command work? If not what is the error message? If it is "UnableToOpenConfigureFile" then you haven't installed IM properly.Code: Select all
magick my-image.jpg -resize 50% my_image_base_name-500.jpg
works like a charm here.magick image.png -resize 50% my_image_base_name-500.png
Code: Select all
echo should already have original image in folder, as well as folders named tiles and samples
set basename=my_image_base_name
set filename=my-image.jpg
set extension=jpg
set imagemagick=C:\path\to\ImageMagick\convert
set /a tilesize=256
set /a samplesize=500
set tilesfolder=tiles
set samplesfolder=samples
echo create tile folders
mkdir %tilesfolder%\%basename%
mkdir %tilesfolder%\%basename%\1000
mkdir %tilesfolder%\%basename%\500
mkdir %tilesfolder%\%basename%\250
mkdir %tilesfolder%\%basename%\125
echo create half-sized versions for tiling (will be discarded later)
%imagemagick% %filename% -resize 50%% %basename%-500.%extension%
%imagemagick% %filename% -resize 25%% %basename%-250.%extension%
%imagemagick% %filename% -resize 12.5%% %basename%-125.%extension%
echo create sample
%imagemagick% %filename% -thumbnail %samplesize%x%samplesize% ./%samplesfolder%/%filename%
echo create tiles
%imagemagick% %filename% -crop %tilesize%x%tilesize% -set filename:tile "%%[fx:page.x/%tilesize%]_%%[fx:page.y/%tilesize%]" +repage +adjoin "./%tilesfolder%/%basename%/1000/%%[filename:tile].%extension%"
%imagemagick% %basename%-500.%extension% -crop %tilesize%x%tilesize% -set filename:tile "%%[fx:page.x/%tilesize%]_%%[fx:page.y/%tilesize%]" +repage +adjoin "./%tilesfolder%/%basename%/500/%%[filename:tile].%extension%"
%imagemagick% %basename%-250.%extension% -crop %tilesize%x%tilesize% -set filename:tile "%%[fx:page.x/%tilesize%]_%%[fx:page.y/%tilesize%]" +repage +adjoin "./%tilesfolder%/%basename%/250/%%[filename:tile].%extension%"
%imagemagick% %basename%-125.%extension% -crop %tilesize%x%tilesize% -set filename:tile "%%[fx:page.x/%tilesize%]_%%[fx:page.y/%tilesize%]" +repage +adjoin "./%tilesfolder%/%basename%/125/%%[filename:tile].%extension%"
echo cleanup
del %basename%-500.%extension%
del %basename%-250.%extension%
del %basename%-125.%extension%
echo DONE
pause
Code: Select all
echo should already have original image in folder, as well as folders named tiles and samples
set basename=images
set image.png=image.png
set extension=png
set imagemagick= magick
set /a tilesize=256
set /a samplesize=500
set tilesfolder=tiles
set samplesfolder=samples
echo create tile folders
mkdir tiles/samples
mkdir tiles/samples/1000
mkdir tiles/samples/500
mkdir tiles/samples/250
mkdir tiles/samples/125
echo create half-sized versions for tiling (will be discarded later)
magick image.png -resize 50%% images-500.png
magick image.png -resize 25%% images-250.png
magick image.png -resize 12.5%% images-125.png
echo create sample
magick image.png -thumbnail 500x500 ./samples/tiles
echo create tiles
magick image.png -crop 256x256 -set image.png:tile "%%[fx:page.x/256]_%%[fx:page.y/256]" +repage +adjoin "./tiles/images/1000/%%[image.png:tile].png"
magick images-500.png -crop 256x256 -set image.png:tile "%%[fx:page.x/256]_%%[fx:page.y/256]" +repage +adjoin "./tiles/images/500/%%[image.png:tile].png"
magick images-250.png -crop 256x256 -set image.png:tile "%%[fx:page.x/256]_%%[fx:page.y/256]" +repage +adjoin "./tiles/images/250/%%[image.png:tile].png"
magick images-125.png -crop 256x256 -set image.png:tile "%%[fx:page.x/256]_%%[fx:page.y/256]" +repage +adjoin "./tiles/images/125/%%[image.png:tile].png"
echo cleanup
del images-500.png
del images-250.png
del images-125.png
echo DONE
pause
Code: Select all
magick image.png -resize 50%% image-500.png
magick image.png -resize 25%% image-250.png
magick image.png -resize 12.5%% image-125.png
magick -limit map 0 -limit memory 0 image.png -crop 256x256 -set filename:tile "%[fx:page.x/256]_%%[fx:page.y/256]" +repage +adjoin tile-%%[filename:tile].png
magick -limit map 0 -limit memory 0 image-125.png -crop 256x256 -set filename:tile "%[fx:page.x/256]_%[fx:page.y/256]" +repage +adjoin tile-%[filename:tile].png
magick -limit map 0 -limit memory 0 image-250.png -crop 256x256 -set filename:tile "%[fx:page.x/256]_%[fx:page.y/256]" +repage +adjoin tile-%[filename:tile].png
magick -limit map 0 -limit memory 0 image-500.png -crop 256x256 -set filename:tile "%[fx:page.x/256]_%[fx:page.y/256]" +repage +adjoin tile-%[filename:tile].png
echo cleanup
del images-500.png
del images-250.png
del images-125.png [\code]