mirror of
https://github.com/storytold/vectorcraft.git
synced 2026-11-15 01:15:25 +00:00
An image over 64 megapixels is scaled down before tracing with a box filter that averaged red, green and blue without weighing them by alpha. A clear pixel (stored as transparent black) next to an opaque one pulled the scaled pixel's color toward black: an opaque red and a clear pixel gave a half-clear red at half its brightness. Each scaled pixel now takes its alpha as the mean of its block and its color from the block's colors weighted by their alpha. A wholly clear block keeps the plain mean of its colors. Every source pixel now counts in exactly one block, so the block edges differ slightly from before and an opaque image can also scale to slightly different values.