A real-time graphics effect able to increase the size of small bitmaps guessing the missing pixels without blurring the images
C Makefile M4 Shell
Latest commit 9eeee4f Nov 5, 2016 @amadvance Update .gitignore
Permalink
Failed to load latest commit information.
doc Add generated doc files Oct 13, 2015
example Recompress example png Oct 22, 2015
test Add new tests with images with width of x16 pixels Oct 22, 2015
.gitignore Update .gitignore Nov 5, 2016
.travis.yml Add Travis CI support Oct 13, 2015
AUTHORS New web address Jul 21, 2015
COPYING First import Apr 24, 2003
HISTORY Minor documentation update Nov 4, 2016
Makefile.am Add automake prefix to support silent make Nov 15, 2015
README Minor documentation update Nov 4, 2016
acinclude.m4 Adds the new scaleK effect and revises the Makefile. Apr 27, 2013
autogen.sh First import Apr 24, 2003
configure.ac Use pkg-config to set CFLAGS and LDFLAGS for libpng Nov 15, 2015
configure.windows-x64 Use a newer MingW compiler Nov 4, 2016
configure.windows-x86 Use a newer MingW compiler Nov 4, 2016
file.c Uncrustify the source code Oct 23, 2015
file.h Enforce memory alignment for SSE2 Oct 23, 2015
getopt.c Uncrustify the source code Oct 23, 2015
makedist.sh Fixes archive disitrbution. Mar 6, 2014
pixel.c Uncrustify the source code Oct 23, 2015
pixel.h Changes license to GPL2+ only. Mar 19, 2014
portable.h Uncrustify the source code Oct 23, 2015
scale2x.c Measured the effect of the "whole" C implementation Nov 4, 2016
scale2x.h Uncrustify the source code Oct 23, 2015
scale3x.c Convert MMX implementation to SSE2 Oct 23, 2015
scale3x.h Changes license to GPL2+ only. Mar 19, 2014
scalebit.c Uncrustify the source code Oct 23, 2015
scalebit.h New web address Jul 21, 2015
scalerx.c Uncrustify the source code Oct 23, 2015
scalex.c Uncrustify the source code Oct 23, 2015

README

Scale2x
=======

Scale2x, Scale3x and Scale4x are real-time graphics effects
able to increase the size of small bitmaps guessing the
missing pixels without blurring the images.

They were originally developed for the AdvanceMAME project
in the year 2001 to improve the quality of old games running
at low video resolutions.

The specification of the algorithm and more details are at :

    http://www.scale2x.it

This package contains some implementations of the effects
in C and SSE2 intrinsics, and command line tools to convert
manually .PNG images.


IMPLEMENTATION
==============

The files scale2x.c and scale3x.c are the fast C and SSE2
implementations of the effects.

The files scalebit.c and scalebit.h are the fast C implementations
of the effects ready to be applied to a generic bitmap.
Note that the implementation of the Scale4x effect is not
obvious without using a big intermediate buffer.

The files scalerx.c is a simple command line processors,
which uses the reference implementation of the effects.

The files scalex.c is another simple command line processors,
which uses the fast implementation of the effects.


TOOLS
=====

The command line tools "scalerx" and "scalex" read a .PNG file
and write another .PNG file with the effect applied.
The syntax of the programs is :

    scalerx [-k N] [-w] FROM.png TO.png
    scalex [-k N] FROM.png TO.png

The option -k can be used to select the scale factor.
The option -w can be used to scale textures with a wraparound effect.

To compile the command line tool you need the libz and libpng
libraries.


EXAMPLES
========

The directory example/ contains some examples of the effects applyed
to a generic image and to a test image.

The suffix of the images means :
    1 - Original image.
    2 - Scale2x effect.
    3 - Scale3x effect.
    4 - Scale4x effect.
    1x - Scaled normally 12 times.
    2x - Scale2x effect and scaled normally up to 12 times.
    3x - Scale3x effect and scaled normally up to 12 times.
    4x - Scale4x effect and scaled normally up to 12 times.

The `x' images have the same final size and can be used to compare
pixel by pixel the result of the effects.