Page 1 of 1

problems when creating a .png out of a vector file

Posted: 2013-03-22T10:36:27-07:00
by imagemagician
I want to create a png file out of a vector file (for example an .eps file).
So I wrote this coding:

Code: Select all

			$image = new Imagick();
			$image->readImage(__DIR__ . DIRECTORY_SEPARATOR . $normalfile);
			$image->setImageFormat("png");
                                                $image->resizeImage(100, 100, imagick::FILTER_LANCZOS, 1);
			$image->writeImage(__DIR__ . DIRECTORY_SEPARATOR . $thumbfile. ".png");
It works, but there are several issues:
- The image ain't resized at all (it still has it's original width and height)
- The vector drawing is often not centered (not in the middle of the png file)
- Sometimes a part of the vector drawing isn't in the created png file.

The idea is to create a png file with the whole vector drawing centered in it and that the vector drawing fills up the created png file.


I'm a complete imagemagick noob, so I hope someone can help me out.