Processing: Masking Fix

I mentioned in my last Processing post that there was a problem with the mask being resized constantly. As the mask was being resized multiple times each frame it soon lost its quality and its masking abilities slowly got worse as the mask got more stretched and blurred.

To get around this I moved the ‘mask = loadImage(“mask.jpg”);’ line from the setup to the draw. With the line in the setup, the mask was loaded once at the beginning and then constantly edited as time passed. Putting it in the draw meant that every time the code runs for each frame, it would reload the original mask so that the quality doesn’t diminish over time and makes sure it doesn’t get blurrier.


Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s

%d bloggers like this: