Skip to content

Instantly share code, notes, and snippets.

View runer112's full-sized avatar

Zachary Wassall runer112

View GitHub Profile
@HybridDog
HybridDog / ssim_perceptual_downscaling.c
Last active June 26, 2024 18:29
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