fast batch converting of .eps to jpg
Posted: 2013-05-14T18:09:19-07:00
First of, i am aware of the fact that jpg is not an ideal format for converting from vector but so far it has been the fastest and i have 200 000 eps files to resize.
I am running ImageMagick 6.8.4-10 2013-04-23 Q8 on Ubuntu 12.04 64 bit:
This is the command i use for converting 1 eps file to several jpeg files in different formats, ive currently just been running it as a command line argument in some php code:
For calculating density i have been using 2 different methods:
1: Using a pre-set value such as 600.
2: getting density by making imagemagick return me the size of the vector and from that calculate the needed density with something like this:
wantedDensity = round(5000*72/$max)
I also check that density is not above 1000 or below 500.
The problem: When running the above command i usually end up with an average time of 6 - 8 seconds per image but for some reason that i can't figure out i get up towards 400 seconds on every 40- 50 image i'm trying to convert. Not sure if i am doing something wrong or the files themselves are hard to convert for some reason.
All the images in this folder are the slow ones with times up to 400 seconds:
https://www.dropbox.com/sh/x7xdnhlwoy2imyf/aMksJNUorw
While the images in this folder usually go pretty fast with an average time below 15 seconds:
https://www.dropbox.com/sh/l3uzuqa0eu448nx/g5zun-XMx6
I am running ImageMagick 6.8.4-10 2013-04-23 Q8 on Ubuntu 12.04 64 bit:
This is the command i use for converting 1 eps file to several jpeg files in different formats, ive currently just been running it as a command line argument in some php code:
Code: Select all
convert -density $density -colorspace sRGB -filter Quadratic $orgFilePath -colorspace sRGB -strip -background white -flatten \
'(' +clone -resize 5000x5000 -write rz_5000x5000/$thumbPath ')' \
'(' +clone -resize 1600x1600 -write rz_1600x1600/$thumbPath ')' \
'(' +clone -resize 1210x1210 -write rz_1210x1210/$thumbPath ')' \
'(' +clone -resize 600x600 -write rz_600x600/$thumbPath ')' \
'(' +clone -resize 512x512 -write rz_512x512/$thumbPath ')' \
'(' +clone -resize 500x500 -write rz_500x500/$thumbPath ')' \
'(' +clone -resize 200x200 -write rz_200x200/$thumbPath ')' -delete 0-6 -resize 128x128 rz_128x128/$thumbPath
1: Using a pre-set value such as 600.
2: getting density by making imagemagick return me the size of the vector and from that calculate the needed density with something like this:
wantedDensity = round(5000*72/$max)
I also check that density is not above 1000 or below 500.
The problem: When running the above command i usually end up with an average time of 6 - 8 seconds per image but for some reason that i can't figure out i get up towards 400 seconds on every 40- 50 image i'm trying to convert. Not sure if i am doing something wrong or the files themselves are hard to convert for some reason.
All the images in this folder are the slow ones with times up to 400 seconds:
https://www.dropbox.com/sh/x7xdnhlwoy2imyf/aMksJNUorw
While the images in this folder usually go pretty fast with an average time below 15 seconds:
https://www.dropbox.com/sh/l3uzuqa0eu448nx/g5zun-XMx6