Convert EPS to PNG nConvert verses Photoshop Elements 7

Discussions on NConvert - the command line tool for image conversion and manipulation

Moderators: XnTriq, xnview

Post Reply
mairondil
Posts: 12
Joined: Fri Feb 26, 2010 7:43 pm

Convert EPS to PNG nConvert verses Photoshop Elements 7

Post by mairondil » Fri Feb 26, 2010 8:37 pm

I have an EPS file that I want to convert to PNG using nConvert. When I open the same EPS file in Photoshop Elements 7, then Save As a PNG file, the resulting PNG is so much better looking, lighter, and full of color. When I convert to PNG using nConvert, it's so dark and looks like it has a lot less colors and way to many shadows.

I've tried everything I can think of: -gamma, -brightness, -conbright, -contrast, -equalize, -normalize, etc. But I can never get the file output by nConvert to match the quality of the file output by Photoshop Elements.

Code: Select all

working.eps : Success
    Format               : Encapsuled Postscript
    Name                 : ps
    Compression          : Uncompressed
    Width                : 431
    Height               : 305
    Components per pixel : 3
    Bits per component   : 8
    Depth                : 24
    # colors             : 16777216
    Color model          : RGB
    Bytes Per Plane      : 1293
    Orientation          : Top Left
    Xdpi                 : 72
    Ydpi                 : 72
    Page(s)              : 1
    Comment              :  Image generated by GPL Ghostscript (device=pnmraw)

    Metadata             : ( IPTC )

from Photoshop.png : Success
    Format               : Portable Network Graphics
    Name                 : png
    Compression          : ZIP
    Width                : 1200
    Height               : 850
    Components per pixel : 4
    Bits per component   : 8
    Depth                : 32
    # colors             : 16777216
    Color model          : RGB
    Bytes Per Plane      : 4800
    Orientation          : Top Left
    Xdpi                 : 200
    Ydpi                 : 200
    Page(s)              : 1
    Metadata             : ( ICC )
    Color Profile        : sRGB IEC61966-2.1
    
"C:\Program Files\XnView\nconvert.exe" -v. -out png -o "from nConvert.png" -32bits -dpi 200 -use_cie "working.eps"
from nConvert.png : Success
    Format               : Portable Network Graphics
    Name                 : png
    Compression          : ZIP
    Width                : 1199
    Height               : 849
    Components per pixel : 4
    Bits per component   : 8
    Depth                : 32
    # colors             : 16777216
    Color model          : RGB
    Bytes Per Plane      : 4796
    Orientation          : Top Left
    Xdpi                 : 200
    Ydpi                 : 200
    Page(s)              : 1    
    
"C:\Program Files\XnView\nconvert.exe" -v. -out png -o "from nConvert with AdobeRGB1998.icc.png" -32bits -dpi 200 -icc -icc_in "C:\Program Files\Common Files\Adobe\Color\Profiles\Recommended\AdobeRGB1998.icc" -icc_out "C:\Program Files\Common Files\Adobe\Color\Profiles\Recommended\AdobeRGB1998.icc" -use_cie "working.eps"
from nConvert with AdobeRGB1998.icc.png : Success
    Format               : Portable Network Graphics
    Name                 : png
    Compression          : ZIP
    Width                : 1199
    Height               : 849
    Components per pixel : 4
    Bits per component   : 8
    Depth                : 32
    # colors             : 16777216
    Color model          : RGB
    Bytes Per Plane      : 4796
    Orientation          : Top Left
    Xdpi                 : 200
    Ydpi                 : 200
    Page(s)              : 1
    
"C:\Program Files\XnView\nconvert.exe" -v. -out png -o "from nConvert with sRGB Color Space Profile.icm.png" -32bits -dpi 200 -icc -icc_in "C:\Program Files\Common Files\Adobe\Color\Profiles\Recommended\sRGB Color Space Profile.icm" -icc_out "C:\Program Files\Common Files\Adobe\Color\Profiles\Recommended\sRGB Color Space Profile.icm" -use_cie "working.eps"
from nConvert with sRGB Color Space Profile.icm.png : Success
    Format               : Portable Network Graphics
    Name                 : png
    Compression          : ZIP
    Width                : 1199
    Height               : 849
    Components per pixel : 4
    Bits per component   : 8
    Depth                : 32
    # colors             : 16777216
    Color model          : RGB
    Bytes Per Plane      : 4796
    Orientation          : Top Left
    Xdpi                 : 200
    Ydpi                 : 200
    Page(s)              : 1
As you can see, I tried 2 different ICC profiles and it didn't make any difference, almost as if nConvert didn't even try to apply an ICC profile. I tried converting the file into a standard JPEG or TIFF, the same thing happens, a very dark dreary reproduction of what Photoshop outputs.

I dragged the same EPS file into Adobe Acrobat 7, and it created an image PDF that looked identical to the PNG produced by Photoshop. I dragged the same EPS file into Microsoft Word 2003 and the image in my Word document looked just like the dark dreary nConvert output files. When I open the EPS file in XnView, it also is dark and dreary and just doesn't look as good as the Photoshop version.

So I'm stumped. Do I have an ICC problem? Do I have a Ghostscript problem? Is it something else? And can any of nConvert's options be used to correct whatever is causing this problem.

mairondil
Posts: 12
Joined: Fri Feb 26, 2010 7:43 pm

Re: Convert EPS to PNG nConvert verses Photoshop Elements 7

Post by mairondil » Fri Feb 26, 2010 8:42 pm

Oh, and I know I could use the -resize 1200 850 to match the Photoshop output PNG.

Code: Select all

"C:\Program Files\XnView\nconvert.exe" -v. -out png -o "from nConvert resize 1200 850.png" -32bits -dpi 200 -use_cie -resize 1200 850 "working.eps"  
from nConvert resize 1200 850.png : Success
    Format               : Portable Network Graphics
    Name                 : png
    Compression          : ZIP
    Width                : 1200
    Height               : 850
    Components per pixel : 4
    Bits per component   : 8
    Depth                : 32
    # colors             : 16777216
    Color model          : RGB
    Bytes Per Plane      : 4800
    Orientation          : Top Left
    Xdpi                 : 200
    Ydpi                 : 200
    Page(s)              : 1 

User avatar
xnview
Author of XnView
Posts: 31607
Joined: Mon Oct 13, 2003 7:31 am
Location: France
Contact:

Re: Convert EPS to PNG nConvert verses Photoshop Elements 7

Post by xnview » Sun Feb 28, 2010 2:18 pm

Is it possible to have the eps and the output png file?
Pierre.

mairondil
Posts: 12
Joined: Fri Feb 26, 2010 7:43 pm

Re: Convert EPS to PNG nConvert verses Photoshop Elements 7

Post by mairondil » Tue Mar 09, 2010 9:15 pm

xnview wrote:Is it possible to have the eps and the output png file?
  • PNG file saved from Adobe Photoshop Elements 7:Image
    • RGB 8
    • 200 dpi
    • 6" x 4.25"
    • No Anti-alias
    • No Interlace
  • PNG file converted with nConvert 5.60: Image
    • -in ps
    • -org_depth
    • -dpi 200
    • -resize 1200 850
    • -32bits
    • -out png

I updated Ghostscript GPL today to the newest version and it did not correct the issue.

User avatar
xnview
Author of XnView
Posts: 31607
Joined: Mon Oct 13, 2003 7:31 am
Location: France
Contact:

Re: Convert EPS to PNG nConvert verses Photoshop Elements 7

Post by xnview » Wed Mar 10, 2010 9:33 am

Ok, ghostscript has a different conversion...
Pierre.

mairondil
Posts: 12
Joined: Fri Feb 26, 2010 7:43 pm

Re: Convert EPS to PNG nConvert verses Photoshop Elements 7

Post by mairondil » Wed Mar 10, 2010 2:57 pm

xnview wrote:Ok, ghostscript has a different conversion...
I assumed as much, because whenever I open an EPS file in an Adobe product, Photoshop Elements, Acrobat, Distiller, Designer, it outputs the same. Whereas I open an EPS file in GSview, XnView, MS Word, etc., it must use Ghostscript to raster.

I've tried playing with -brightness, -contrast, -conbright, -gamma, -gammasat, -hls, -truecolors, etc., with little success. I'm a newbie when it comes to some of these finer points in working with image files. If anyone can figure out what nConvert options can output a converted file similar to the Photoshop example, I would be greatly appreciated. I'll keep trying and I'll post back here if I hit paydirt.

mairondil
Posts: 12
Joined: Fri Feb 26, 2010 7:43 pm

Re: Convert EPS to PNG nConvert verses Photoshop Elements 7

Post by mairondil » Wed Mar 10, 2010 4:49 pm

xnview wrote:Ok, ghostscript has a different conversion...
Pierre, I think I've identified the problem. It's not a matter of filters or something, it's CIE, it doesn't look like it's working correctly in nConvert, at least when converting EPS files to PNG files. Here I'll give you some examples, nConvert with and without the -use_cie option and Ghostscript with and without the -dUseCIEColor option. The only one that comes out anywhere near the file created with Photoshop is the Ghostscript -dUseCIAColor option.

Code: Select all

"C:\Program Files\XnView\nconvert.exe" -use_cie -in ps -org_depth -dpi 200 -resize 1200 850 -32bits -out png -o "from nConvert 5.6-use_cie-org_depth-200dpi-1200x850-32bits-in PS-out PNG.png" porsche.eps
Image

Code: Select all

"C:\Program Files\XnView\nconvert.exe" -in ps -org_depth -dpi 200 -resize 1200 850 -32bits -out png -o "from nConvert 5.6-org_depth-200dpi-1200x850-32bits-in PS-out PNG.png" porsche.eps
Image

Code: Select all

"C:\Program Files\gs\gs8.71\bin\gswin32c.exe" -dGraphicsAlphaBits=4 -dDOINTERPOLATE -g1200x850 -r200 -dSAFER -sDEVICE=png16m -o "porsche-gs 8.71-d GraphicsAlphaBits 4-d DOINTERPOLATE-g 1200 x 850-r 200-SAFER-DEVICE png16m-o.png" porsche.eps
Image

Code: Select all

"C:\Program Files\gs\gs8.71\bin\gswin32c.exe" -dGraphicsAlphaBits=4 -dDOINTERPOLATE -g1200x850 -r200 -dSAFER -dUseCIEColor -sDEVICE=png16m -o "porsche-gs 8.71-d GraphicsAlphaBits 4-d DOINTERPOLATE-g 1200 x 850-r 200-SAFER-UseCIEColor-DEVICE png16m-o.png" porsche.eps
Image

User avatar
xnview
Author of XnView
Posts: 31607
Joined: Mon Oct 13, 2003 7:31 am
Location: France
Contact:

Re: Convert EPS to PNG nConvert verses Photoshop Elements 7

Post by xnview » Thu Mar 11, 2010 8:00 am

Ok, right, it's an error in the use_cie param
Pierre.

mairondil
Posts: 12
Joined: Fri Feb 26, 2010 7:43 pm

Re: Convert EPS to PNG nConvert verses Photoshop Elements 7

Post by mairondil » Thu Mar 11, 2010 4:24 pm

xnview wrote:Ok, right, it's an error in the use_cie param
I'm looking forward to the next release, if nConvert is faster than Ghostscript.

User avatar
xnview
Author of XnView
Posts: 31607
Joined: Mon Oct 13, 2003 7:31 am
Location: France
Contact:

Re: Convert EPS to PNG nConvert verses Photoshop Elements 7

Post by xnview » Thu Mar 11, 2010 4:45 pm

mairondil wrote:
xnview wrote:Ok, right, it's an error in the use_cie param
I'm looking forward to the next release, if nConvert is faster than Ghostscript.
NConvert can't be faster than ghostscript because NC use it
Pierre.

mairondil
Posts: 12
Joined: Fri Feb 26, 2010 7:43 pm

Re: Convert EPS to PNG nConvert verses Photoshop Elements 7

Post by mairondil » Fri Mar 19, 2010 4:40 pm

xnview wrote:Ok, right, it's an error in the use_cie param
Is this an error in ghostscript or in nConvert?

I thought I had found a good solution (code below) in using nConvert for TIF and PDF files and ghostscript for EPS files, but I've got some EPS files intended for full bleed, so they are larger dimensions and include cut marks in the corners.

If I could use nConvert on the EPS files and use the -crop options, like I do with my PSDF files, but I can't find an equivalent to -crop in ghostscript. Ghostscript options '-dUseCropBox', '-dUseTrimBox', and '-dEPSCrop' don't do anything from what I can see.

Anyway, here's my code to quickly convert TIF, EPS, and PDF files to PNG.First, I have a batch file:

Code: Select all

@ECHO OFF
START "Convert artwork to PNG files" /MIN "C:\Conversion\Convert artwork to PNG.vbs" ""%1""
I put a shortcut to the batch file in my 'Send To' folder, so I can right click on an image in Windows Explorer and select it from the Send To menu.

Here's my 'Convert artwork to PNG.vbs' code:

Code: Select all

Option Explicit
Dim dtmStart, objArgs, fso, wshShell, strArg, strPath, strFile, strExt, strBase, strExec, strExecArgs, errRun, strResult, strSavePath
dtmStart						 = Timer()
Set objArgs					 = WScript.Arguments
Set fso						  = WScript.CreateObject("Scripting.FileSystemObject")
Set wshShell					= WScript.CreateObject("WScript.Shell")		
For Each strArg in objArgs
	strPath					  = fso.GetParentFolderName(strArg) & "\"
	strSavePath				 = strPath
	strFile					  = fso.GetFileName(strArg)
	strExt					   = fso.GetExtensionName(strArg)
	strBase					  = fso.GetBaseName(strArg)
	Set strExec 				= New StringBuilder
	Select Case strExt
		Case "tif"
			strExec.Append """C:\Program Files\XnView\nconvert.exe"""
			strExec.Append "-in tiff"
			strExec.Append "-org_depth"
			strExec.Append "-ctype cmyk"
			strExec.Append "-o """ & strSavePath & strBase & " copy.png"""
			strExec.Append "-out png"
			strExec.Append "-c 4"
			strExec.Append "-dpi 200"
			strExec.Append "-32bits"
			strExec.Append "-resize 1200 850"				'If working on a 6" x 4.25" piece
			'strExec.Append "-resize 1700 1100"				'If working on a 8.5" x 5.5" piece
			'strExec.Append "-overwrite"
			strExec.Append """" & strPath & strFile & """"
		Case "eps"
			strExec.Append """C:\Program Files\gs\gs8.71\bin\gswin32c.exe"""		'Ghostscript version 8.71
			'strExec.Append """C:\Program Files\gs\gs8.54\bin\gswin32c.exe"""		'Ghostscript version 8.54
			strExec.Append "-q"
			strExec.Append "-dUseCIEColor"
			strExec.Append "-dDOINTERPOLATE"
			strExec.Append "-g1200x850"					'If working on a 6" x 4.25" piece
			'strExec.Append "-g1700x1100"					'If working on a 8.5" x 5.5" piece
			strExec.Append "-r200"
			strExec.Append "-sDEVICE=png16m"
			strExec.Append "-o """ & strSavePath & strBase & " copy.png"""
			'strExec.Append "-overwrite"
			strExec.Append """" & strPath & strFile & """"
		Case "pdf"
			strExec.Append """C:\Program Files\XnView\nconvert.exe"""
			strExec.Append "-in pdf"
			strExec.Append "-o """ & strSavePath & strBase & " copy.png"""
			strExec.Append "-out png"
			strExec.Append "-dpi 200"
			strExec.Append "-use_cie"
			strExec.Append "-32bits"
			'strExec.Append "-overwrite"
			strExec.Append "-crop 250 674 1200 850"			'If working on a 6" x 4.25" piece
			strExec.Append """" & strPath & strFile & """"
		Case Else
			MsgBox "Incompatible file type. Try an EPS, TIF, or PDF file type."
			Wscript.Quit
	End Select
	errRun = wshShell.Run(strExec.ToString, 0, TRUE)
	Set strResult				= New StringBuilder
	If errRun > 0 Then
		strResult.Append "Something happened. Not sure what it is. Error code: "
		strResult.Append errRun
	Else
		strResult.Append "Converted """
		strResult.Append strFile
		strResult.Append """ into """
		strResult.Append strBase
		strResult.Append " 2 copy.png"""
		strResult.Append vbCrLf
		strResult.Append vbCrLf
		strResult.Append " in """
		strResult.Append strSavePath
		strResult.Append """."
	End If
	strResult.Append vbCrLf
	strResult.Append vbCrLf
	strResult.Append "Completed in "
	strResult.Append FormatNumber(Timer()-dtmStart,2)
	strResult.Append " seconds"
	MsgBox strResult.ToString
Next
'From http://www.15seconds.com/HowTo/pg000929.htm
Class StringBuilder
	Dim arr, growthRate, itemCount
	Private Sub Class_Initialize()
		growthRate				  = 50
		itemCount					= 0
		ReDim arr(growthRate)
	End Sub
	Public Sub Append(ByVal strValue)
		If itemCount > UBound(arr) Then ReDim Preserve arr(UBound(arr) + growthRate)
		arr(itemCount)			 = strValue
		itemCount					= itemCount + 1
	End Sub
	Public Function ToString()
		'ToString					= Join(arr,"")		'Since I'm passing each option as a separate argument,
		ToString					 = Join(arr, " ")		'I need to use a space to join the sub-strings together.
	End Function
End Class

mairondil
Posts: 12
Joined: Fri Feb 26, 2010 7:43 pm

Re: Convert EPS to PNG nConvert verses Photoshop Elements 7

Post by mairondil » Fri Mar 19, 2010 4:58 pm

Argh. nConvert can't output an EPS file?

mairondil
Posts: 12
Joined: Fri Feb 26, 2010 7:43 pm

Re: Convert EPS to PNG nConvert verses Photoshop Elements 7

Post by mairondil » Fri Mar 19, 2010 5:20 pm

I used Ghostscript to convert from EPS to PNG, then used nConvert to crop the PNG.

Post Reply