Accessing image attributes

adladl
edited March 2014 in How To...

Hi all, I'm relatively new to programming and to Processing, but not a complete dummy :P. I would like to know if there is any way to gain image info from a loaded PImage object? How do i get the image width and height it pixels?

Thanks in advance!

Tagged:

Answers

  • PImage img = loadImage("filename"):
    int imgW = img.width;
    int imgH = img.height;
    

    For more detail see the reference

Sign In or Register to comment.