Tag Info

New answers tagged

2

find . -type f | while read IN; do if [ "x$(file -b --mime-type $IN)" = "ximage/png" ]; then convert png:$IN jpg:$IN.jpg; fi; done; Meaning of arguments: . Find in the current directory -type f Just find files, not directories/sockets/etc. while read IN; do Put each filename into the variable IN and run the loop on it. if [ "x$(file -b ...


1

You can reset the virtual canvas coordinates by doing +repage after the crop: convert %1 -crop 100x200+0+0 +repage %~n1_01.png convert %1 -crop 100x200+0+200 +repage %~n1_02.png convert %1 -crop 100x200+0+400 +repage %~n1_03.png convert %1 -crop 100x200+0+600 +repage %~n1_04.png Also you don't need a batch file to split the image into tiles; if you ...


-1

have a look at this. mogrify is a powerful scripting tool for imagemagick http://www.imagemagick.org/script/mogrify.php (and *.bmp)


0

A simple for loop in Bash, OS X' default shell, would suffice: for f in *.bmp; do convert "$f" -alpha on -fill none -draw 'color 0,0 replace' "${f%%.bmp}.png"; done It uses string manipulation to replace the file extension for the output file.


3

ImageMagick uses libjpeg-turbo (http://sourceforge.net/projects/libjpeg-turbo) and the maximum dimensions are defined in the file jmorecfg.h. I could not find a good source why this value was chosen but according to the comment it was chosen to prevent an overflow. #define JPEG_MAX_DIMENSION 65500L /* a tad under 64K to prevent overflows */


0

If you have a Mac this is very easy to do using Automator. You just need three actions: Ask for finder items Render PDF pages as images Move finder items You can even select the color model, format (12 available), resolution and compression quality. Just to test it out, I converted a PDF file I have here with 207 pages: Using "600dpi/RGB/best quality ...


0

Another option would be sejda-console (requires Java): sejda-console pdftojpeg --files input.pdf --resolution 300 --output /outputdirectory Full documentation: Usage: sejda-console pdftojpeg options --files -f value... : pdf file to operate on: a single pdf file (EX. -f /tmp/file1.pdf or -f /tmp/password_protected_file2.pdf:secret123) (required) ...


2

I would recommend GhostScript: gs -sDEVICE=jpeg -r300x300 -dNOPAUSE -dBATCH -sOutputFile="image00.jpg" "input.pdf" r parameter is resolution gs -sDEVICE=jpeggray -r300x300 -dNOPAUSE -dBATCH -sOutputFile="image00.jpg" "input.pdf" This one is for grayscale output.


0

I found this elegant and short answer here http://blog.endpoint.com/2011/04/determining-dominant-image-color.html $ convert Waffle.jpg -scale 1x1\! -format '%[pixel:u]' info:- rgb(219,166,94)



Top 50 recent answers are included