Er, sorry forgot to mention... it's a little bit of both actually.  I spent
way more time on this than I'd like to admit, but basically the bilinear
interpolation implementation in Aseprite works right, except for some weird
edge cases.  I found that the output from from Aseprite bilinear code is
more or less the same as the output from Photoshop except for small images
and the scaled image is at a slightly different position, i.e. one or two
pixels.

I tried re-implementing the algorithm, but ended up with basically the same
problem.  I'll email you a more in-depth explanation, no need to put it all
here.

And good call on the !=, I honestly don't know what I was thinking.


On Sun, Dec 22, 2013 at 11:37 AM, David Capello <notifications@github.com>wrote:

> In src/raster/resize_image_unittest.cpp:
>
> > +  algorithm::resize_image(src, dst, algorithm::ResizeMethod::RESIZE_METHOD_NEAREST_NEIGHBOR, NULL, NULL);
> > +
> > +  ASSERT_TRUE(compare_images(dst, test_dst)) << "resize_image() result does not match test image!";
> > +}
> > +
> > +TEST(ResizeImage, BilinearInterpRGBType)
> > +{
> > +  Image* src = create_image_from_data(IMAGE_RGB, test_image_base_3x3, 3, 3);
> > +  Image* dst = Image::create(IMAGE_RGB, 9, 9);
> > +
> > +  // Pre-rendered test image for comparison
> > +  Image* test_dst = create_image_from_data(IMAGE_RGB, test_image_scaled_9x9_bilinear, 9, 9);
> > +
> > +  algorithm::resize_image(src, dst, algorithm::ResizeMethod::RESIZE_METHOD_BILINEAR, NULL, NULL);
> > +
> > +  ASSERT_TRUE(compare_images(dst, test_dst)) << "resize_image() result does not match test image!";
>
> This test is failing. I don't know if the bilinear algorithm is wrong too
> or the test data is correct.
>
> —
> Reply to this email directly or view it on GitHub<https://github.com/aseprite/aseprite/pull/11/files#r8520420>
> .
>



-- 
Joel Madigan
Doc Honcho Industries
dochoncho@gmail.com