Convert EPS to JPEG wrong Bounding Box size ?

Questions and postings pertaining to the usage of ImageMagick regardless of the interface. This includes the command-line utilities, as well as the C and C++ APIs. Usage questions are like "How do I use ImageMagick to create drop shadows?".
Post Reply
Maskime

Convert EPS to JPEG wrong Bounding Box size ?

Post by Maskime »

Hi everybody,

I'm trying to convert an EPS file into a JPEG.
So i'm typing the folowing command :

Code: Select all

convert my_eps_file.eps my_jpeg_file.jpg
But the result is not exactly what i expected... The image is really smaller than what photoshop is currently displaying.
so after looking some hours on internet, looking in differents documentation on your site i was able to come with the folowing command :

Code: Select all

identify PAF018050003_L.eps

PAF018050003_L.eps EPT 1656x1242=>397x298 397x298+0+0 DirectClass 16-bit 469.836kb 
First strange thing it's talking about EPT althought my file is an EPS.
Second strange thing 1656x1242 is the size i want the jpeg to be and 397x298 is the converted file size.

I go on and add the verbose option :

Code: Select all

identify -verbose PAF018050003_L.eps

Image: PAF018050003_L.eps
  Format: EPT (Encapsulated PostScript with TIFF preview)
  Class: DirectClass
  Geometry: 397x298+0+0
  Base geometry: 1656x1242
  Resolution: 72x72
  Print size: 5.51389x4.13889
  Units: Undefined
  Type: ColorSeparation
  Endianess: Undefined
  Colorspace: CMYK
  Depth: 16/8-bit
  Channel depth:
    cyan: 8-bit
    magenta: 8-bit
    yellow: 8-bit
    black: 1-bit
  Channel statistics:
    cyan:
      min: 0 (0)
      max: 234 (0.917647)
      mean: 133.765 (0.524568)
      standard deviation: 74.0163 (0.29026)
    magenta:
      min: 0 (0)
      max: 222 (0.870588)
      mean: 135.362 (0.530832)
      standard deviation: 68.7094 (0.269448)
    yellow:
      min: 0 (0)
      max: 221 (0.866667)
      mean: 142.872 (0.560283)
      standard deviation: 66.3969 (0.26038)
    black:
      min: 0 (0)
      max: 0 (0)
      mean: 0 (0)
      standard deviation: 0 (0)
  Total ink density: 261%
  Rendering intent: Undefined
  Interlace: None
  Background color: white
  Border color: cmyk(223,223,223,0)
  Matte color: grey74
  Transparent color: black
  Page geometry: 397x298+0+0
  Dispose: Undefined
  Iterations: 0
  Compression: Undefined
  Orientation: Undefined
  Properties:
    create-date: 2008-04-18T18:38:48+02:00
    modify-date: 2008-04-18T18:38:50+02:00
    ps:HiResBoundingBox: 397.44x298.08+0+0
    ps:Level: Adobe-3.0 EPSF-3.0

    signature: 5b5adcca36b272c8713d8e66beeb983380ca544261daf9f52b38671552cfb28f
  Profiles:
    Profile-8bim: 18294 bytes
    unknown[2,0]: 
    unknown[224,225]: 0x00000000: ffffffff ff60ff02 2bffff0e ffffff03 43ff6fff  $-----`--+-------C-o
0x00000014: 32ff7e62 ffffff72 58ffff22 58ff703a ffff7f44  -2-~b---rX--"X
0x00000028: 703affff 7f446bff 5d6f7337 ff00               -p:---D
    Profile-icc: 557168 bytes
      Europe ISO Coated FOGRA27
    Profile-xml-code: 15849 bytes
  Artifacts:
    verbose: true
  Tainted: False
  Filesize: 469.836kb
  Number pixels: 115.533kb
  Version: ImageMagick 6.4.0 04/12/08 Q16 http://www.imagemagick.org
As you can see the Base geometry is 1656x1242 but the ps:HiResBoundingBox is 397.44x298.08+0+0

So here is the question :
How can i tell IM i want the convert to take the base geometry size and not the bonding box size ?

Thanks in advance for any help given.
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: Convert EPS to JPEG wrong Bounding Box size ?

Post by fmw42 »

try adding +repage right after you input image

convert input +repage ...otheroptions... output
Maskime

Re: Convert EPS to JPEG wrong Bounding Box size ?

Post by Maskime »

Hi,

Thanks, but it doesn't work.
I've tried :

Code: Select all

convert my_eps_file.eps +repage my_jpg_file.jpg

convert my_eps_file.eps -repage myWidthxmyHeight my_jpg_file.jpg
But none seems to work every time i get the tiny picture instead of the big one...

Any other idea that could help me ?
martinw17
Posts: 39
Joined: 2006-09-07T02:10:27-07:00
Location: Brighton, UK

Re: Convert EPS to JPEG wrong Bounding Box size ?

Post by martinw17 »

I'm having a similar problem. It seems to me that in order to convert an EPS file created from Photoshop to (say) a JPEG in the correct/same size you need to:
- Determine the base geometry and use this, e.g.
convert my.eps -resize [basex]x[basey] out.jpg
OR
- Identify the density setting as applied by Photoshop and specify that, e.g.:
convert -density 300 my.eps out.jpg

(If you save the EPS in Photoshop with a density of 72, i.e. ImageMagick's default, then convert works as expected).

Here's the problem: how do I determine either the base geometry or density using identify?

Regards,
Martin
KingCanadian
Posts: 12
Joined: 2012-05-26T04:19:09-07:00
Authentication code: 13

Re: Convert EPS to JPEG wrong Bounding Box size ?

Post by KingCanadian »

Any news about this??
It seems to be my actual problem:

Photoshop uses the "Base Geometry" size and IM uses the "Geometry" by default.
How to make IM use "Base Geometry" size for conversion.

Code: Select all

Image: P:\ELO\Zeitschriften\prog\01_01_0001.eps
  Format: PS (PostScript)
  Mime type: application/postscript
  Class: DirectClass
  Geometry: 851x688+0+0
  Base geometry: 3544x2866
  Resolution: 300x300
  Print size: 2.83667x2.29333
  Units: PixelsPerInch
  Type: ColorSeparation
  Base type: ColorSeparation
  Endianess: Undefined
  Colorspace: CMYK
  Depth: 16/8-bit
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: Convert EPS to JPEG wrong Bounding Box size ?

Post by fmw42 »

Can't you just use the density of 300 to do the conversion? Or does dividing the base geometry by the geometry give your the needed density?
KingCanadian
Posts: 12
Joined: 2012-05-26T04:19:09-07:00
Authentication code: 13

Re: Convert EPS to JPEG wrong Bounding Box size ?

Post by KingCanadian »

I could use the density of 300 to get the correct Geometry.

Is there a way to tell IM to use the density of the EPS automatically?
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: Convert EPS to JPEG wrong Bounding Box size ?

Post by fmw42 »

You can get the density from string formats in one step and put them into variables, then use the variables in your command line to convert the file. See %x and %y at http://www.imagemagick.org/script/escape.php

In Unix:

Code: Select all

xydensity=`convert -ping image.eps -format "%xx%y" info:`
convert -density $xydensity image.eps image.jpg
Post Reply