Standard Algorithm

The Standard algorithm is the default pixelation algorithm in Image2pixel. It uses a combination of downsampling and color quantization techniques to produce classic pixel art from any image.

How It Works

The Standard algorithm works in two main steps:

  1. Downsampling (Pixelation): The original image is divided into blocks of pixels based on the selected Block Size. Each block is then replaced with a single color determined by the average color of all pixels in that block.
  2. Color Quantization: The algorithm reduces the number of colors in the image to match the selected Color Count using the Median Cut algorithm, ensuring that the most important colors are preserved.

This approach creates the classic pixel art look with uniform, blocky pixels and a limited color palette.

Parameters

Block Size

The Block Size parameter controls the size of each pixel in the output image. Larger values create a more pixelated, blocky look with fewer details, while smaller values preserve more details but create a less distinct pixel art appearance.

Value Effect Best For
1-4 Subtle pixelation, high detail preservation Detailed sprites, complex textures
5-12 Moderate pixelation, good balance of detail and pixel art style Most pixel art, game assets
13-32 Strong pixelation, highly stylized appearance Low-resolution styles, retro effects

Colors

The Colors parameter determines the maximum number of colors in the output image. This affects the color depth and visual complexity of the pixel art.

Value Effect Best For
2-8 Highly limited color palette, high contrast 1-bit or 3-bit style pixel art, GameBoy-inspired artwork
9-32 Moderate color palette, good balance of simplicity and color depth 16-color console style, SNES-era pixel art
33-96 Rich color palette, maintains more color nuance Detailed pixel art, more modern pixel art styles

Color Quantization

The Standard algorithm uses Median Cut color quantization to reduce the number of colors in the image. This algorithm works by:

  1. Creating a 3D histogram of all colors in the image (in RGB color space)
  2. Recursively splitting the color space along the axis with the largest range until the desired number of color buckets is reached
  3. Computing the average color for each bucket to create the final color palette
  4. Mapping each pixel to the closest color in the palette

This approach ensures that the most common and visually important colors in the image are preserved, while similar colors are merged together.

Transparency Support

As of version 1.3.2, the Standard algorithm fully supports transparency in images and GIFs. Transparent pixels in the input are preserved during processing, allowing you to create pixel art with transparent backgrounds or partially transparent elements.

The algorithm detects pixels with an alpha value below 10 (on a scale of 0-255) and treats them as fully transparent, preserving them throughout the pixelation and color quantization process.

Example Usage

Creating Classic Pixel Art Characters

For character sprites and avatars, try these settings:

Creating 8-bit Style Landscapes

For retro-style landscapes and backgrounds:

Creating Minimalist Icons

For simple, recognizable icons:

Comparison with SLIC Algorithm

The Standard algorithm differs from the SLIC algorithm in several key ways:

Feature Standard Algorithm SLIC Algorithm
Pixel Shape Uniform, grid-based squares Irregular, content-aware shapes
Detail Preservation Uniform across the image Adaptive based on image content
Parameter Complexity Simple (2 parameters) More complex (5 parameters)
Processing Speed Faster Slower (especially with higher iteration counts)
Best For Classic pixel art, retro game aesthetics Modern pixel art, stylized abstractions, complex scenes

Tips for Best Results

For more advanced customization options, see the Color Palettes documentation.