We are about to switch to a new forum software. Until then we have removed the registration on this forum.
If I use resize on a loaded image, does it change the resize the actual image in memory?
memimg = loadImage("c:dirtscan.png");
memimg.resize(480,480); // scale to fit screen 480x480
sclimg=memimg;
image(sclimg,imgstartcol,imgstartrow);
So now memimage.height and memimage.width =480?
If I want to get back to the full scale raw image in memory to execute image processing on I have to reload the image each time after i resize it?
Is that correct?
Answers
What happened when you put together a little test program to find out yourself?
The
resize()
function is destructive. Once you resize an image, you can't get its exact original without reloading the file again.Other than creating a little example program (which should always be your first step), we can look at the source for PImage to be sure:
From this, you can see that the internal pixels, width, and height variables are changed, and no copies are kept around.
https://forum.Processing.org/two/discussion/15473/readme-how-to-format-code-and-text
Get a clone of the original PImage w/ get() before using resize(): *-:)