Jump to content

Hqx: Difference between revisions

From Wikipedia, the free encyclopedia
Content deleted Content added
Cousteau (talk | contribs)
m External links: http://hiend3d.com/hq2x.html links 404; added 404 template
m clean up / dead link template normalisation to assist db scan using AWB (10310)
Line 1: Line 1:
{{lowercase title}}
{{About|[[image scaling]] filter|.hqx files|BinHex}}
{{About|[[image scaling]] filter|.hqx files|BinHex}}
{{lowercase title}}


In [[image processing]], '''hqx''' ("hq" stands for "high quality" and "x" stands for magnification) is one of the [[pixel art scaling algorithms]] developed by [[Maxim Stepin]], used in [[emulator]]s such as [[Nestopia]], [[FCEUX]], [[higan (emulator)|higan]], [[Snes9x]], [[ZSNES]] and many more. There are three hqx filters: '''hq2x''', '''hq3x''', and '''hq4x''', which magnify by factor of 2, 3, and 4 respectively. For other magnification factors, this filter is used with [[nearest-neighbor interpolation|nearest-neighbor]] scaling.
In [[image processing]], '''hqx''' ("hq" stands for "high quality" and "x" stands for magnification) is one of the [[pixel art scaling algorithms]] developed by [[Maxim Stepin]], used in [[emulator]]s such as [[Nestopia]], [[FCEUX]], [[higan (emulator)|higan]], [[Snes9x]], [[ZSNES]] and many more. There are three hqx filters: '''hq2x''', '''hq3x''', and '''hq4x''', which magnify by factor of 2, 3, and 4 respectively. For other magnification factors, this filter is used with [[nearest-neighbor interpolation|nearest-neighbor]] scaling.
Line 13: Line 13:


==External links==
==External links==
* [http://hiend3d.com/hq2x.html hq2x]{{404}}, [http://hiend3d.com/hq3x.html hq3x]{{404}}, and [http://hiend3d.com/hq4x.html hq4x]{{404}} at HiEnd3D.com
* [http://hiend3d.com/hq2x.html hq2x]{{Dead link|date=July 2014}}, [http://hiend3d.com/hq3x.html hq3x]{{Dead link|date=July 2014}}, and [http://hiend3d.com/hq4x.html hq4x]{{Dead link|date=July 2014}} at HiEnd3D.com
* [https://code.google.com/p/hqx/ hqx project] at code.google.com
* [https://code.google.com/p/hqx/ hqx project] at code.google.com
* [https://github.com/Arcnor/hqx-java/wiki/Usage hqx-java project] Arcnor project - a free Java port with a demo of usage
* [https://github.com/Arcnor/hqx-java/wiki/Usage hqx-java project] Arcnor project - a free Java port with a demo of usage
* [https://bitbucket.org/Tamschi/hqxsharp hqxSharp project] a port of hqx with added support for transparency, custom tolerances and seamless tiling
* [https://bitbucket.org/Tamschi/hqxsharp hqxSharp project] a port of hqx with added support for transparency, custom tolerances and seamless tiling
* [https://code.google.com/p/2dimagefilter/ 2d image filter project] at code.google.com including the hqx filters and more
* [https://code.google.com/p/2dimagefilter/ 2d image filter project] at code.google.com including the hqx filters and more

{{graphics-software-stub}}


[[Category:Image processing]]
[[Category:Image processing]]


{{graphics-software-stub}}

Revision as of 16:43, 17 July 2014


In image processing, hqx ("hq" stands for "high quality" and "x" stands for magnification) is one of the pixel art scaling algorithms developed by Maxim Stepin, used in emulators such as Nestopia, FCEUX, higan, Snes9x, ZSNES and many more. There are three hqx filters: hq2x, hq3x, and hq4x, which magnify by factor of 2, 3, and 4 respectively. For other magnification factors, this filter is used with nearest-neighbor scaling.

Image enlarged 3× with the nearest-neighbor interpolation
Image enlarged by 3× with hq3x algorithm


Algorithm

First, the color of each of the 8 pixels around the source pixel is compared to the color of the source pixel. Shapes are detected by checking for pixels of similar color according to a threshold. This gives total of 28 = 256 combinations of similar or dissimilar neighbors. To expand the single pixel into a 2×2, 3×3, or 4×4 block of pixels, the arrangement of neighbors is looked up in a predefined table which contains the necessary interpolation patterns.

The interpolation data in the lookup tables are constrained by the requirement that continuity of line segments must be preserved, while optimizing for smoothness. Generating these lookup tables is relatively slow, and is the major source of complexity in the algorithm: the render stage is very simple and fast, and designed to be capable of being performed in real time.