Converting DPI of an EPS-file [solved]

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
DerUnbenannte

Converting DPI of an EPS-file [solved]

Post by DerUnbenannte »

Hi,
I am trying to change the density (DPI) of an EPS-file with the following command:

Code: Select all

convert original.eps -density 300 EPT:300.eps
But the result is another than expected. The output-file is very small and grainy.
I guess that some things gets lost when converting the image.
The only difference between the input-file and the output-file should be the density - independent of the other properties.
Is it possible to do that?

You can find the output of 'identify -verbose ...' of both files below.

Thank you.

identify -verbose original.eps:

Code: Select all

original[5].eps EPT 159x102 159x102+0+0 DirectClass 48kb 
Image: original[5].eps
  Format: EPT (Encapsulated PostScript with TIFF preview)
  Geometry: 159x102
  Class: DirectClass
  Type: Palette
  Endianess: Undefined
  Colorspace: RGB
  Channel depth:
    Red: 8-bits
    Green: 8-bits
    Blue: 8-bits
  Channel statistics:
    Red:
      Min: 35 (0.137255)
      Max: 255 (1)
      Mean: 237.011 (0.929454)
      Standard deviation: 59.3746 (0.232842)
    Green:
      Min: 31 (0.121569)
      Max: 255 (1)
      Mean: 236.707 (0.928262)
      Standard deviation: 60.3788 (0.23678)
    Blue:
      Min: 32 (0.12549)
      Max: 255 (1)
      Mean: 236.773 (0.928522)
      Standard deviation: 60.1571 (0.23591)
  Colors: 32
  Histogram:
       824: ( 35, 31, 32)	#231F20
       127: ( 35, 32, 33)	#232021
       216: ( 35, 32, 32)	#232020
        60: ( 36, 32, 33)	#242021
        10: ( 49, 45, 46)	#312D2E
         2: ( 49, 46, 46)	#312E2E
         2: ( 49, 46, 47)	#312E2F
         3: ( 63, 59, 60)	#3F3B3C
         3: ( 63, 60, 61)	#3F3C3D
         1: ( 63, 60, 60)	#3F3C3C
         4: ( 76, 73, 74)	#4C494A
         2: ( 76, 74, 74)	#4C4A4A
         2: ( 76, 74, 75)	#4C4A4B
        18: ( 90, 87, 88)	#5A5758
         5: ( 90, 88, 89)	#5A5859
         8: ( 90, 88, 88)	#5A5858
         1: ( 91, 88, 89)	#5B5859
         1: (104,101,102)	#686566
         1: (104,102,103)	#686667
         1: (118,116,116)	#767474
         2: (132,129,130)	#848182
        54: (145,143,143)	#918F8F
        10: (145,143,144)	#918F90
         3: (158,157,157)	#9E9D9D
        14: (172,171,171)	#ACABAB
         1: (173,171,171)	#ADABAB
         5: (186,185,185)	#BAB9B9
        14: (200,199,199)	#C8C7C7
         6: (214,213,213)	#D6D5D5
         4: (227,227,227)	grey89
        14: (241,241,241)	#F1F1F1
     14800: (255,255,255)	white
  Rendering-intent: Undefined
  Resolution: 72x72
  Units: Undefined
  Filesize: 48kb
  Interlace: None
  Background Color: white
  Border Color: #DFDFDF
  Matte Color: grey74
  Page geometry: 159x102+0+0
  Dispose: Undefined
  Iterations: 0
  Compression: Undefined
  Orientation: Undefined
  Comment:  Image generated by GPL Ghostscript (device=pnmraw)

  Signature: 128bfc93b4dad86f0451c55f500454b259836c0076ce4be220c34f9448c4e2f1
  Profile-iptc: 4826 bytes
0x00000000: 42494d04 25000000 00001000 00000000 00000000  8BIM-%--------------
0x00000190: 00000000 00000038 42494d04 2f000000 00004a50  --------8BIM-/-----J
0x00000320: 0f010048 00000048 00000000 00000000 000000d0  P---H---H-----------
0x000004b0: 02000040 02000000 00000000 00000018 03000064  ----@---------------
0x00000640: 02000000 01c00300 00b00400 0001000f 2701006c  d----------------'--
[...hundrets of lines...]
0x00004010: ac3eadda ac4eadda adefdecd e01defda acec1ead  -->---N-------------
0x000041a0: daac2ead daac3ead daac4ead daadeffe ecedcedb  ---.--->---N--------
0x00004330: eba14262 49beae88 88888888 88888888 88888888  ---BbI--------------
0x000044c0: 88888888 88888888 88888888 88888888 88888888  --------------------
0x00004650: 88888888 88888888 88888888 88888888 88888888  --------------------
0x000047e0: 88888888 88888888 88888888 88888888 88888888  --------------------
0x00004970: 88888888 88888888 88888888 88888888 88888888  --------------------
0x00004b00: 88888888 88888888 88888888 88888888 88888888  --------------------
0x00004c90: 88888888 88888888 88888888 88888888 88888888  --------------------
0x00004e20: 88888888 88888888 88888888 88888888 88888888  --------------------
0x00004fb0: 88888888 88888888 88888888 88888888 88888888  --------------------
0x00005140: 88888888 88888888 88888888 88888888 88888888  --------------------
0x000052d0: 88888888 88888888 88888888 88888888 88888888  --------------------
0x00005460: 88888888 88888888 88888888 88888888 88888888  --------------------
[...hundrets of lines...]
0x000474a0: 88888888 88888888 88888888 88888888 88888888  --------------------
0x00047630: 88888888 88888888 88888888 88888888 88888888  --------------------
0x000477c0: 88888888 88888888 88888888 88888888 88888888  --------------------
0x00047950: 88888888 88888888 88888888 88888888 88888888  --------------------
0x00047ae0: 88888888 88888888 88888888 88888888 88888888  --------------------
0x00047c70: 88888888 888800                               -------
  Tainted: False
  Version: ImageMagick 6.2.4 02/10/07 Q16 http://www.imagemagick.org
identify -verbose 300.eps:

Code: Select all

300.eps EPT 38x24 38x24+0+0 DirectClass 3kb 
Image: 300.eps
  Format: EPT (Encapsulated PostScript with TIFF preview)
  Geometry: 38x24
  Class: DirectClass
  Type: Palette
  Endianess: Undefined
  Colorspace: RGB
  Channel depth:
    Red: 8-bits
    Green: 8-bits
    Blue: 8-bits
  Channel statistics:
    Red:
      Min: 35 (0.137255)
      Max: 255 (1)
      Mean: 233.636 (0.916219)
      Standard deviation: 64.4024 (0.252558)
    Green:
      Min: 31 (0.121569)
      Max: 255 (1)
      Mean: 233.275 (0.914805)
      Standard deviation: 65.4922 (0.256832)
    Blue:
      Min: 32 (0.12549)
      Max: 255 (1)
      Mean: 233.348 (0.915089)
      Standard deviation: 65.2696 (0.255959)
  Colors: 12
  Histogram:
        60: ( 35, 31, 32)	#231F20
        19: ( 35, 32, 32)	#232020
         4: ( 35, 32, 33)	#232021
         1: ( 36, 32, 33)	#242021
         1: ( 49, 46, 46)	#312E2E
         1: ( 76, 73, 74)	#4C494A
         4: (145,143,143)	#918F8F
         1: (172,171,171)	#ACABAB
         1: (200,199,199)	#C8C7C7
         1: (227,227,227)	grey89
         1: (241,241,241)	#F1F1F1
       818: (255,255,255)	white
  Rendering-intent: Undefined
  Resolution: 72x72
  Units: Undefined
  Filesize: 3kb
  Interlace: None
  Background Color: white
  Border Color: #DFDFDF
  Matte Color: grey74
  Page geometry: 38x24+0+0
  Dispose: Undefined
  Iterations: 0
  Compression: Undefined
  Orientation: Undefined
  Comment:  Image generated by GPL Ghostscript (device=pnmraw)

  Signature: c6e75cd066d8db8ee6b1500dae69ebb839fb0ef32ffd81a85fca34f598711c95
  Tainted: False
  Version: ImageMagick 6.2.4 02/10/07 Q16 http://www.imagemagick.org
DerUnbenannte

Re: Converting DPI of an EPS-file [solved]

Post by DerUnbenannte »

Here's the solution:

Code: Select all

convert -density 150 original.eps EPT:150.eps
Just the order of the options was wrong. :?
User avatar
anthony
Posts: 8883
Joined: 2004-05-31T19:27:03-07:00
Authentication code: 8675308
Location: Brisbane, Australia

Re: Converting DPI of an EPS-file [solved]

Post by anthony »

Question... was the resulting image a 'vector image' or a 'raster' image?

I am just wondering if IM managed to do the conversion for that without rasterization.
Anthony Thyssen -- Webmaster for ImageMagick Example Pages
https://imagemagick.org/Usage/
Post Reply