# RMagick convert EPS to PNG =\> poor quality

**URL:** <https://www.ruby-forum.com/t/rmagick-convert-eps-to-png-poor-quality/132871>\
**Category:** Ruby\
**Created:** [March 25, 2008, 2:06pm UTC](https://www.ruby-forum.com/t/rmagick-convert-eps-to-png-poor-quality/132871 "2008-03-25T14:06:20Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![RHjorth](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/a5b964/32.png) [@RHjorth](https://www.ruby-forum.com/u/RHjorth)\
**Post date:** [March 25, 2008, 2:06pm UTC](https://www.ruby-forum.com/t/rmagick-convert-eps-to-png-poor-quality/132871/1 "2008-03-25T14:06:20Z")

</div>

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 🙂

---

<div class="post-metadata">

**Author:** ![RHjorth](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/a5b964/32.png) [@RHjorth](https://www.ruby-forum.com/u/RHjorth)\
**Post date:** [March 25, 2008, 2:27pm UTC](https://www.ruby-forum.com/t/rmagick-convert-eps-to-png-poor-quality/132871/2 "2008-03-25T14:27:19Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![RHjorth](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/a5b964/32.png) [@RHjorth](https://www.ruby-forum.com/u/RHjorth)\
**Post date:** [March 25, 2008, 3:25pm UTC](https://www.ruby-forum.com/t/rmagick-convert-eps-to-png-poor-quality/132871/3 "2008-03-25T15:25:51Z")

</div>

Hi Tim,

Absolutely brilliant - thanks!
