Read image frame of specified size (Magick++)

Help
rsc
2012-05-15
2013-03-27
  • rsc
    rsc
    2012-05-15

    Hi,
    could you explain to me how size parameter from read function- http://www.graphicsmagick.org/Magick++/Image.html#read could be used? Does it give a possibilty to do some scaling during load of image from file? Is it dependant on file type?

    I have made some tests with quite big png and jpeg files and results were not consistent, so probably I missed something and read function with specified size doesn't work as I have supposed.

    Maybe there is some example out there, that could clarify this?

    Thanks!

     
  • The size hint only has an effect for JPEG files.  It depends on functionality in the JPEG library and uses features specific to the JPEG format.  PNG format is not a multi-resolution format so it is necessary to read all of the data from the PNG and scale it.  If image resize is a problem, then look for the thumbnail() and scale() methods which work best for large images.

    Bob

     
  • rsc
    rsc
    2012-05-16

    Thank you very much for a clarification and hint!

    Rafal