I don't know if Image::Magick is available as a ppm package (I hardly use windows), but if it isn't, you should be able to use the "convert" command line tool from the image magick site and call it directly using system(). Slightly less efficient, but easy enough.