Converting images to another format with phMAgick

August 9, 2009 by nuno costa 4 comments

phMagick->convert()

Use this function to convert an image to another format

 

$p = new phmagick('source.jpg', 'destination.png');
$p->convert();

 

This example converts source.jpg to destination.png, optionaly setImageQuality() can be used to specify the quality of the new image

 

 

4 comments so far Add Your Comment

  1. by johny why on November 13 2009 at 12:10

    hi again
    can i convert pdf’s to gif’s?
    thanks!

  2. by nuno costa on November 16 2009 at 00:23

    @johny

    I’ve never tried converting pdf to gif’s, but there is no reason why it can’t be done

  3. by johny why on November 16 2009 at 02:31

    conversion to pdf works! pdf-to-png gives me smallest output size.

    but pdf’s larger than about 200 Kb come out distorted. is there any way to control the resolution, color depth, or any other conversion options?

    thanks!

  4. by johny why on November 16 2009 at 02:48

    i’m also finding very large pdf’s (600 Kb, maybe less) don’t get processed at all.

More from francodacosta.com

© francodacosta.com - All rights reserved