Re: [dev] [farbfeld] cubic resizing filter

From: FRIGN <dev_AT_frign.de>
Date: Sat, 30 Jan 2016 20:12:13 +0100

On Sat, 30 Jan 2016 10:37:49 -0800
Tim Elliott <tle_AT_holymonkey.com> wrote:

Hey Tim,

> Here is a cubic (catmull-rom) resizing filter for farbfeld:
> https://github.com/ender672/farbfeld-resize
>
> Example usage is:
> $ jpg2ff < in.jpg | ./resize 123 456 | ff2png > out.png
>
> The arguments indicate the desired maximum height and width. The image
> above will be resized to fit inside a 123x456 box while preserving the
> aspect ratio.

wow, what great news! This is so cool! :D Care to share your experience
using farbfeld to implement this? :)

> It has no external dependencies, but includes a single-file library to
> perform resampling.

That's the spirit! :)

> Interpolation happens with 8-bit components, so this filter truncates
> 16-bit colors to 8-bit, resamples, and then scales 8-bit colors back
> up.
> I could look into supporting 16-bit colors in the interpolator, but
> would be curious what the use cases are first.

It's hard to say actually. On the one hand, you do want to support 16
Bit to minimize discretization errors, on the other hand, it would
not surprise me if it didn't make any difference.
Maybe you could try it out with a simple white-to-black-gradient and
running it through your resizer. Posterization should occur in 8-Bit
mode.
You might want to start with a 1000x200 gradient and scale it down to
900x180.

Thanks for your hard work! :) I'll add your tool to the farbfeld page
when I find the time.

Cheers

FRIGN
-- 
FRIGN <dev_AT_frign.de>
Received on Sat Jan 30 2016 - 20:12:13 CET

This archive was generated by hypermail 2.3.0 : Sat Jan 30 2016 - 20:24:09 CET