• Stars
    star
    187
  • Rank 198,987 (Top 5 %)
  • Language
    JavaScript
  • Created over 13 years ago
  • Updated almost 7 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

hqx Pixel Art Scaling Algorithm in JavaScript

js-hqx

hqx Pixel Art Scaling Algorithm for JavaScript/Canvas

This project is a direct port of the C source code for the hqx scaling algorithm. It uses the HTML5 Canvas element to get an manipulate pixel data of an image.

The source is unoptimized and probably many times slower than it could be. RGBA components are first packed into integers processed by hqx and then unpacked again. The source is pretty large (~400kb), because all 3 hqx scaling algorithms are included, but it can be gzipped quite well (~27kb).

Some basic support for alpha transparency has been added.

Demo

Simple Test Image

Biolab Disaster Scaled With hqx

Usage

var scaledCanvas = hqx( originalImage, 3 );

The second argument is the scaling factor. hqx supports 2, 3 and 4. See test.html for an example.

More Repositories

1

qoi

The “Quite OK Image Format” for fast, lossless image compression
C
6,657
star
2

jsmpeg

MPEG1 Video Decoder in JavaScript
JavaScript
6,222
star
3

Ejecta

A Fast, Open Source JavaScript, Canvas & Audio Implementation for iOS
Objective-C
2,795
star
4

wipeout-rewrite

C
2,449
star
5

jsmpeg-vnc

A low latency, high framerate screen sharing server for Windows and client for browsers
C
2,329
star
6

Impact

HTML5 Game Engine
JavaScript
1,916
star
7

q1k3

A tiny FPS for js13k
JavaScript
1,471
star
8

underrun

Twin stick shooter game in 13kb of JavaScript/WebGL
JavaScript
1,075
star
9

pl_mpeg

Single file C library for decoding MPEG1 Video and MP2 Audio
C
695
star
10

JavaScriptCore-iOS

Apple's JavaScript Engine, with modified project files for iOS
C++
685
star
11

qoa

The “Quite OK Audio Format” for fast, lossy audio compression
C
641
star
12

wipeout

WipEout (PSX) Model Viewer in WebGL/Three.js
JavaScript
520
star
13

voidcall

Real time strategy game in 13kb of JavaScript/WebGL
JavaScript
365
star
14

WebGLImageFilter

Fast image filters for Browsers with WebGL support
JavaScript
322
star
15

TwoPointFive

3D View Plugin for the Impact HTML5 Game Engine
JavaScript
140
star
16

Quakespasm-Rift

Quake for Oculus Rift
C
138
star
17

Asaph

A micro-blogging system, focusing on collecting links and images
PHP
97
star
18

ttt

Tiny Texture Tumbler – A JS library and an editor to create textures
HTML
78
star
19

pagenode

Pagenode – No Bullshit Content Management
PHP
68
star
20

OculusWeb

A fast and lean HTTP/WebSocket Oculus Rift Tracking Server for Windows and Mac
C
57
star
21

impact-box2d

Box2D Plugin for the Impact Game Engine
JavaScript
51
star
22

JS360

A NET framework for JavaScript on the XBox with XNA.
C#
48
star
23

json-format

JSON Pretty Printer for JavaScript
JavaScript
38
star
24

picturelicious

Social Imaging Platform
PHP
36
star
25

impact-splash-loader

A loading screen for Impact that shows the Impact logo
JavaScript
34
star
26

rectpack

Super Simple Rectangle Packing for JS
JavaScript
13
star
27

arduboy-games

My Arduboy Mini Games
C
12
star
28

jQuery-JSH

Tiny jQuery Plugin for JavaScript SyntaxHighlighting
11
star
29

pagenode-legacy

Older version of Pagenode with a complete admin interface
PHP
2
star