Using the image::FilterType::Triangle filter seems to give incorrect results. I'm assuming that a triangle filter is the same thing as what other software usually calls a "linear" filter, because in the documentation it says "Linear Filter" under that filter type (source: https://docs.rs/image/0.13.0/image/enum.FilterType.html ).
This is the code I run:
extern crate image;
use std::fs::File;
use std::path::Path;
fn main() {
// Load image.
let image_path = Path::new("heart.png");
let img = image::open(&image_path).unwrap();
// Resize image.
let width = 1024;
let height = 1024;
let filter = image::FilterType::Triangle;
let img = img.resize_exact(width, height, filter);
// Write image.
let output_path = Path::new("output.png");
let ref mut fout = File::create(&output_path).unwrap();
let _ = img.save(fout, image::PNG).unwrap();
}
This is my input image:

This is the image that the program outputs:

This is the result you get if you upscale the image in GIMP with linear interpolation:

Hi. I recently opened a PR (https://github.com/PistonDevelopers/image/pull/661) to fix some issues with image scaling. I tried running your code with my changes applied to the image library:

That's awesome, excellent work!
I guess I wait for the PR to get accepted before I close this issue, right?
I think so, yeh.
This was fixed in the latest version https://github.com/PistonDevelopers/image/pull/673
Most helpful comment
Hi. I recently opened a PR (https://github.com/PistonDevelopers/image/pull/661) to fix some issues with image scaling. I tried running your code with my changes applied to the image library:
