Input transform functions FTW!!111
In the last devlog update I mentioned two new operations: one which contours the boundary between light/dark areas of a black/white image (or any grayscale image, for that matter, but it's meant to be used for anti-aliased black/white binary images), and one which can 'automagically' generate interesting depth for a binary input image. Now, it dawned on me that manipulating the depth values of an image doesn't necessarily equate to a new toolpath, it just means having a different image with which to perform the existing operations on. So the automagic operation I mentioned before actually is something else...
I've decided to implement a system that allows the user to specify a transform function that is applied to the values of each individual pixel. This would allow a whole variety of interesting things. The use will be able to access specific properties of the pixel and feed them into an arithmetic expression comprising functions and operations. So you could pass in the X coordinate of the pixel to a sine function and multiply that result with the value of the pixel in the input image, and get some funky wavy result out the other side that's fed as the input image into the rest of PixelCNC. This result would also be what users would see where the input image mesh is drawn.
The ideas I have so far for pixel properties that will be able to be referenced by transform functions are:
- Image Value
- X coordinate
- Y coordinate
- Euclidean Distance (from nearest black/white boundary)
- Manhattan Distance (ditto)
The transform functions that can be applied to these values:
- sine wave
- square wave
- triangle wave
- sawtooth wave
- arbitrary 2D curve: a user-specified spline as a plot of points on a graph, where X = input value, Y = output value
Operations combining these functions and pixel properties:
- maximum: the greater of two values
- minimum: the lesser of two values
- exponent: bring one value to the power of another
This all sounds like a great starting point that will allow users to do all kinds of really neat things. If their input image is lacking in some fashion they will be able to mix it up a bit to produce really neat effects. I'm excited to implement this sort of thing, and it is the reason PixelCNC is still in alpha. I think it will also prove useful for me to dream up a variety of prefabricated transforms for users to select from. I'll also provide the ability for users to define their own which they can save to their configuration to re-use later in different projects.
Get PixelCNC: Fast and Easy CAM for Images!
Leave a comment
Log in with itch.io to leave a comment.