Negation as posterize

Post your nifty GP projects here!

Moderator: MSandro

Post Reply
mguzdial
Posts: 70
Joined: Sep 15th, '15, 11:21

Negation as posterize

Post by mguzdial » Nov 14th, '15, 19:27

I've shared negation before. Here's a version of negation that's a little different:
  • The inverse amount is a local variable.
  • I'm using the new get-x and get-y blocks I created so that I can use the existing set color, rather than setting RGB separately.
negation-as-posterize.png
Using this version, you can turn Big Ben into this:
255-big-ben.png
But if you subtract from something OTHER THAN 255, you get some really cool effects, some of which are akin to posterizing.

Here's 128:
128-bigben.png
400 is fun, too, but the forum won't let me upload it. A limit on how much I can upload?

If you remove the copy from costume block, you can negate the negation, to get other sets of interesting colors.

I got the outputs above by a new block I created "save costume as image" (seen at the bottom of the blocks image above). Using that, I can compute an image, then save it back to the images pane for export.

Using that new block, I discovered a couple of (what I think are) bugs in GP:
  • If you click the save costume as block more than once, it saves multiple costumes to the pane. That's not really a problem. But if you delete one of the "128-bigben" images, all the images with that name are deleted.
  • I had to right click on my costume name slot to set it to be string. But when I executed the script, it turned the slot back to readonly -- which is why my clicks on the name to change the string kept creating another copy of the costume on the images pane.
Attachments
negate-posterize.gpp
(638.83 KiB) Downloaded 303 times
pixelsxy.gp
(1.01 KiB) Downloaded 305 times

JohnM
Posts: 379
Joined: Sep 11th, '15, 14:42

Re: Negation as posterize

Post by JohnM » Nov 15th, '15, 01:17

mguzdial wrote:but the forum won't let me upload it. A limit on how much I can upload?
Yes, there is a limit to the number of attachements per post. It was 5, now it is 20.

mguzdial
Posts: 70
Joined: Sep 15th, '15, 11:21

Re: Negation as posterize

Post by mguzdial » Nov 15th, '15, 15:26

Thanks, John!

I tried putting the negate/posterize block inside an animate loop. That way, you can click on the constant and sweep up and down to explore the space. Because it takes a moment to update from the costume and iterate over the pixels, it's a little slow, but it works.
animate-negate-posterize.png

Post Reply