Quantcast

RMagick convert EPS to PNG => poor quality

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

RMagick convert EPS to PNG => poor quality

RHjorth
Hi all,

After some initial troubles having RMagick (and ImageMagick) working
on windows, it finally works and quite well I might add.

However when convertin a EPS (yes, a barcode) to PNG (and rotating it)
the quality are unusable poor - the code for doing it are faily
simple:

psc = Magick::ImageList.new(ps_name)
psc.density = "300x300"
psc = psc.rotate(270)
psc.write(im_name)

I think the density are ignored.

What else am I doing wrong?

Please help me out here :)

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: RMagick convert EPS to PNG => poor quality

Tim Hunter-3
RHjorth wrote:

> Hi all,
>
> After some initial troubles having RMagick (and ImageMagick) working
> on windows, it finally works and quite well I might add.
>
> However when convertin a EPS (yes, a barcode) to PNG (and rotating it)
> the quality are unusable poor - the code for doing it are faily
> simple:
>
> psc = Magick::ImageList.new(ps_name)
> psc.density = "300x300"
> psc = psc.rotate(270)
> psc.write(im_name)
>
> I think the density are ignored.
>
> What else am I doing wrong?
>
> Please help me out here :)

This is a tricky conversion that typically generates a lot of questions
in the ImageMagick forum. The problem is that the Ghostscript fonts
aren't designed for low-resolution devices like monitors.

Try specifying the density when reading the image, like this:

psc = Magick::Image.read(ps_name) { self.density = "300x300" }.first

If that doesn't help, open a Support Request on the RMagick project on
RubyForge and attach a copy of your EPS file. I'll be glad to take a
look and consult with the IM developers if necessary.


--
Posted via http://www.ruby-forum.com/.

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: RMagick convert EPS to PNG => poor quality

RHjorth
Hi Tim,

Absolutely brilliant - thanks!

/René

On 25 Mar., 14:27, Tim Hunter <[hidden email]> wrote:

> RHjorth wrote:
> > Hi all,
>
> > After some initial troubles having RMagick (and ImageMagick) working
> > on windows, it finally works and quite well I might add.
>
> > However when convertin a EPS (yes, a barcode) to PNG (and rotating it)
> > the quality are unusable poor - the code for doing it are faily
> > simple:
>
> > psc = Magick::ImageList.new(ps_name)
> > psc.density = "300x300"
> > psc = psc.rotate(270)
> > psc.write(im_name)
>
> > I think the density are ignored.
>
> > What else am I doing wrong?
>
> > Please help me out here :)
>
> This is a tricky conversion that typically generates a lot of questions
> in the ImageMagick forum. The problem is that the Ghostscript fonts
> aren't designed for low-resolution devices like monitors.
>
> Try specifying the density when reading the image, like this:
>
> psc = Magick::Image.read(ps_name) { self.density = "300x300" }.first
>
> If that doesn't help, open a Support Request on the RMagick project on
> RubyForge and attach a copy of your EPS file. I'll be glad to take a
> look and consult with the IM developers if necessary.
>
> --
> Posted viahttp://www.ruby-forum.com/.- Skjul tekst i anførselstegn -
>
> - Vis tekst i anførselstegn -


Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: RMagick convert EPS to PNG => poor quality

PCT-Hiker
In reply to this post by Tim Hunter-3
Tim Hunter-3 wrote
RHjorth wrote:
> Hi all,
>
> After some initial troubles having RMagick (and ImageMagick) working
> on windows, it finally works and quite well I might add.
>
> However when convertin a EPS (yes, a barcode) to PNG (and rotating it)
> the quality are unusable poor - the code for doing it are faily
> simple:
>
> psc = Magick::ImageList.new(ps_name)
> psc.density = "300x300"
> psc = psc.rotate(270)
> psc.write(im_name)
>
> I think the density are ignored.
>
> What else am I doing wrong?
>
> Please help me out here :)

This is a tricky conversion that typically generates a lot of questions
in the ImageMagick forum. The problem is that the Ghostscript fonts
aren't designed for low-resolution devices like monitors.

Try specifying the density when reading the image, like this:

psc = Magick::Image.read(ps_name) { self.density = "300x300" }.first

If that doesn't help, open a Support Request on the RMagick project on
RubyForge and attach a copy of your EPS file. I'll be glad to take a
look and consult with the IM developers if necessary.


--
Posted via http://www.ruby-forum.com/.
I am just getting started with Ruby - RMagick - ImageMagicK
and I was curious if u could give me a jumpstart on my 1st Ruby file??

I am a high school Math teacher and I am I trying to create graphs that I can save and then insert into OO Writer or put on the web.  I am learning to create these graphs using Asymptote withing a LaTex file om MS Vista.

Currently I have a graph.eps file that I want to convert to a jps, gif or probably png.  Actually, ideally I wish I could create a SVG file so i wouldn't lose the quality of the EPS file.

My reason for you is that I current use ImageMagicK command:
  convert graph.eps graph.png
and no matter what option i use with the CONVERT command, the quality of my output file is nowhere near the EPS file.

If u can suggest any code to do the above I appreciate it....
OR
Point me to a place where I can get some basic examples to get me started on this current situation.

Thx and have a great day!
Loading...