Jump to content

Plugin idea: equations

Recommended Posts

Here's my idea for a plugin. Basically it would let the user input equations that would take RGBA/HSV values as input and would output other RGBA/HSV values. When you hit "ok" the plugin would apply your equation to each pixel of the image individually. I know it doesn't sound that amazing but I think you could do some really cool stuff with it. For example:

The equations

R = B

B = R

would simply switch the red and blue values of every pixel.

If you had a black and white image,

A = 255 - V * 2.55

would make each pixel more transparent the lighter it is. It would be really handy for isolating line art.

Or you could do stuff like

R = R + (S / 100) * (255 - R)

which would increase the redness of each pixel based on how saturated it is.

I have no idea how plugins are coded, so would something like this even be possible?

Link to comment
Share on other sites

Try out Simon's PixelLab. :-)


The Doctor: There was a goblin, or a trickster, or a warrior... A nameless, terrible thing, soaked in the blood of a billion galaxies. The most feared being in all the cosmos. And nothing could stop it, or hold it, or reason with it. One day it would just drop out of the sky and tear down your world.
Amy: But how did it end up in there?
The Doctor: You know fairy tales. A good wizard tricked it.
River Song: I hate good wizards in fairy tales; they always turn out to be him.

Link to comment
Share on other sites

Or, if you're brave, CodeLab. The default CodeLab script is the perfect environment to try out your equations.

Just change this section:

// TODO: Add pixel processing code here
           // Access RGBA values this way, for example:
           // CurrentPixel.R = (byte)PrimaryColor.R;
           // CurrentPixel.G = (byte)PrimaryColor.G;
           // CurrentPixel.B = (byte)PrimaryColor.B;
           // CurrentPixel.A = (byte)PrimaryColor.A;

To something like this (based on your switch R with B example):

byte R=CurrentPixel.B;
byte B=CurrentPixel.R;
CurrentPixel.R = R;
CurrentPixel.B = B;


ambigram signature by Kemaru

[i write plugins and stuff]

If you like a post, upvote it!

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Create New...