Skip to content

Instantly share code, notes, and snippets.

View rlewkowicz's full-sized avatar
😃
Idk, things are pretty good right now

Ryan Lewkowicz rlewkowicz

😃
Idk, things are pretty good right now
View GitHub Profile
@HybridDog
HybridDog / ssim_perceptual_downscaling.c
Last active September 15, 2026 03:37
SSIM-based perceptual image downscaling for PNG images
// SPDX-License-Identifier: MIT
//
// This program contains an implementation of SSIM-based perceptual image
// downscaling for PNG images.
// The program can be twice as fast when compiled with -Ofast.
// The program behaviour can be adjusted with predefined preprocessor macros:
// * -DTILEABLE: Assume images wrap around at corners. This should be enabled
// when downscaling tileable textures.
// * -DGAMMA_INCORRECT: Downscale without applying the sRGB EOTF and OETF.
// When downscaling images with symbolic meaning, e.g. screenshots of text or