Created by a human, with a brain badgeA badge with a character next to the text "Web 14," indicating that the site may contain slightly offensive materialDo What The Fuck You Want To Public License badgeTrans flag badgemi toki e Toki Ponamade with MY OWN TWO PAWS badgeNo cookies badgeNo tracking or analytics badgeMade with server-side scripting badgeHosted on home internet badge


Bad Apple!!

git: https://9S15Y.cc/git/BadApple.git
tar: https://9S15Y.cc/git/BadApple.tar.gz
Point positions output
BFAS patch (also included in source)

Base download
Inverted download
With white points download
Influence regions download
Voronoi download
Only voronoi download
Fireworks download


These animations were rendered using a three-quarters-baked art program I made, BFAS. The code here generates positions for colored and white points which are fed into BFAS and assembles a final video.

The point movement is as follows:
  • The screen is divided into regions by flood filling
  • Regions have points matching their color status assigned based on region sizes and proximity
  • Points are pulled into their assigned region ~one by one if they are outside of it
  • Directional voronoi relaxation is done (a point at the center left of a U would move down, not right)
    • This is horribly inefficient, causing the process to take 54 hours on my pretty beefy machine
      • (My answer to every question was "I'm lazy, let's just brute force")
    • Output is attached so that you don't have to run that if you want to play with anything or use the point positions for something else
  • 4-mean smoothing is applied because the relaxation goes all the way each time which causes some jittering (relaxation is done at 480x360)
A small program then forwards point positions to BFAS, waits for it to render a frame's colors and output to shared memory, reads a frame for an image mask from the original video through piped ffmpeg, applies it to BFAS' frame with forked ImageMagick, and pipes the resulting frame to another ffmpeg instance. This takes between 1 and 2.5 hours depending on the variant with a 7700XT.

Renders

Base

BFAS, which these were all rendered with, uses non-sibsonian (I used to know what that meant) natural neighbor interpolation for smoothing out colors. That allows one to define what the color must be at a certain location, and a gradient is created to do so for all points placed. It is most commonly (only?) used for geological surveying.

Inverted


With White Points

This was my original vision for this project. There were issues with rendering this variant initially due to some bugs, however, so I tried rendering without them (and then did a bunch of work with that before finally coming back to this). I think I like the version without them better so that became the "main" version, but the white points do look great during some sections.

Influence Regions

In natural neighbor interpolation only certain points influence the color of a certain pixel. This debugging mode for BFAS colors each pixel with the average color of all of those that are influencing its own (instead of a weighted average).

Voronoi

If you haven't heard of a Voronoi diagram, it is when a region is divided into cells based on the closest point to each coordinate. (The points are not visible here.)

Only Voronoi

The above, without constraining color to the colored regions. This is not a perfect diagram because the white areas are separate regions, and their points do not affect / are not affected by adjacent colored points.

Fireworks (Epilepsy Warning)

"Fireworks" was a bug in BFAS while working on natural neighbor implementation. It looked neat so I added it as an option. Unfortunately this video did not turn out too well; the fireworks effect looks much better with only a few points (say 5-7, this is 20 plus one in each corner).

Development Photos

A screenshot of a terminal ASCII output for development. It is showing whether pixels are black or white.
A screenshot of a terminal ASCII output for development. It is showing a voronoi diagram of points on Reimu's shadow.
A screenshot of a Processing program that was used to work on point snapping to regions and voronoi relaxation. Several points are outside of a drawn black object.
A screenshot of a Processing program that was used to work on point snapping to regions and voronoi relaxation. The points have been snapped to the edges of the drawn black object.
The first successful frame rendered through BFAS:
An image with spread out, gradiented colors filling everything.
An image testing normal output.
An image testing voronoi output.
An image testing influenced display output.
An image testing fireworks output.
"I think my memory leak might be related to other memory bugs. Just a hunch."
A rendered frame with very heavy artifacting.
(I haven't fixed the memory leak, BFAS just gets restarted every 150 frames rendered :D)
An image mask test with a glow surrounding the primary focus.