schrum2 / MM-NEATv2

MM-NEAT version 2.0 is no longer supported. Please get MM-NEAT 3+ from https://github.com/schrum2/MM-NEAT
Other
11 stars 5 forks source link

Enhanced Picture Remixer #359

Open schrum2 opened 7 years ago

schrum2 commented 7 years ago

The picture remixer is great, but we've noticed that it cannot do any shifting, skewing, or distorting of the original image. Therefore, we should make an enhanced version that bases the new picture outputs on an entire region from the source image rather than a single pixel.

Here is one way we might be able to accomplish this.

Define a "remixImageWindow" parameter that defines the size of an input window around each pixel. The pixel should be at the center of this window. On the original image, the CPPN will be queried at all pixels within the window (ignoring pixels outside the bounds of the picture). This process will produce H, S, and B values each time the CPPN is queried. Average all of the H results together to get a single H value, the S values to get a single S value, and the B values to get a single B value. This final resulting HSB will be used to define the color in the output image of a single pixel.

Try to make this enhanced version of the picture remixer within the original remixer. The original remixer is just a special case of what I described above, with a remixImageWindow value of 1, so generalize your existing methods instead of making new ones.

This scheme may require some tweaking to create interesting results, but start with the approach above and see what happens.

schrum2 commented 7 years ago

You implemented the window, but it did not accomplish the tweaking and distorting we desired. I'll leave this issue open for now, but at the moment I don't know how to expand on it. Contribute ideas if you have any, but otherwise move on to other tasks.

schrum2 commented 7 years ago

I have a pretty drastic idea for enhancing the picture remixer. It involves the CPPN using LOTs of new inputs. For this attempt at improving the picture remixer, keep all of the old code around rather than changing it. However, comment out any method that you replace.

Instead of averaging the H,S,B values within a predefined window, make the CPPN accept a large number of inputs within the sample window. You will need an additional parameter, called "remixSamplesPerDimension". This parameter will be used to determine how many inputs there are to the CPPN: 4 inputs for x, y, distance, and bias, then remixSamplesPerDimensionremixSamplesPerDimension3 inputs for the HSB (hence 3) values from (up to) remixSamplesPerDimension*remixSamplesPerDimension pixels within the sampling window of the original image (Note that we no longer explicitly identify the HSB value at the precise x,y coordinates).

The idea is that you take the window size and divide it by (remixSamplesPerDimension - 1) to figure out how much horizontal and vertical space there is between each sample pixel, and you progress through the sample window reading the HSB values at those pixels. Not that because remixSamplesPerDimension is fixed, increasing the window size means the sample pixels will be more spread out.

Once the code works, try it with a small remixSamplesPerDimension value to start, like 3.

schrum2 commented 7 years ago

A new idea I have is to include a height output for the CPPN that treats the 2D image as if it were on a sheet. The height output would effectively raise or depress the image at the given point, and tug on the surrounding points, causing some stretching. However, I have no idea how to render such an effect, so this issue should be considered on hold indefinitely.