AS-Scale2X (frequently referred to as Scale2x or its ActionScript implementation AS3 Scale2x) is a real-time pixel-art scaling algorithm designed to double the size of small bitmaps while preserving sharp edges and smoothing out jagged diagonals without introducing any blur.
Originally created by Andrea Mazzoleni in 2001 for the AdvanceMAME emulator project to enhance retro arcade graphics on high-resolution monitors, it became a staple filter in retro-gaming emulators, GameMaker projects, and graphics utilities. How the Algorithm Works
Unlike heavy bilinear or bicubic interpolation filters that calculate a gradient and cause a “blurry” look, Scale2x uses clean pattern matching.
The 3×3 Grid: The filter scans the original image, evaluating a single target pixel (P) along with its immediate North (A), West ©, East (B), and South (D) neighbors.
Sub-Pixel Splitting: The algorithm duplicates the target pixel P into a new 2×2 block of four sub-pixels (P₁, P₂, P₃, P₄).
The Matching Rule: It tests if adjacent neighboring colors match. If two adjacent neighbors match in color, it curves the corner of the sub-pixel to match them.
Formula Example: If A == C and A ≠ B and C ≠ D, then the top-left sub-pixel P₁ = A. Otherwise, P₁ = P. Key Benefits Scale2x & EPX
Leave a Reply