Skip to content

Instantly share code, notes, and snippets.

@patrickfav
Last active August 29, 2015 14:16
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save patrickfav/21aa5bc96cd6fb9dbed1 to your computer and use it in GitHub Desktop.
Save patrickfav/21aa5bc96cd6fb9dbed1 to your computer and use it in GitHub Desktop.
Windows Batch Imagemagick png to pdf wrapped cmyk-jpeg: pass path as paramter like so: .\convert_cmyk.bat C:\my-path-to-pngs\
@echo off
echo This script converts png files to cmyk colorspaced jpgs wrapped in pdf for latex
echo Start converting...
echo.
for %%f in (%~1*) do if /i %%~xf==.png (
echo Converting %%f to cmyk jpeg compressed %%~nf.pdf
convert %%f +profile "*" -profile "path/to/rgb.icc" -profile "path/to/cmyk.icc" -strip -sampling-factor 1x1 -quality 95 -compress JPEG %%~pf\%%~nf.pdf
)
echo.
echo Done converting.
echo.
PAUSE
@patrickfav
Copy link
Author

This was used in my master thesis to convert all pngs to cmyk jpg pdfs, a format that is easy to use with latex

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment