Sorry to sound confusing.
the GD library opens images and de-compresses them from JPG or PNG into
raw data. That raw data-image is resized, and when you save/view the image, it is re-compressed.
So you could use imagecopyresized() on any image format, providing
GD knows how to compress ad uncompress it.