Git Product home page Git Product logo

Comments (4)

saucecontrol avatar saucecontrol commented on May 30, 2024

That error is caused by a bad interaction between the planar pipeline's cache (because your source image is a JPEG) and the scaler, because point sampling doesn't consume all the input pixels. It's not a scenario I have covered in my tests because it's really not intended to be used that way. I'd recommend against using nearest neighbor interpolation when downscaling images in general, and particularly when downscaling JPEG images. The sample image you provided in #6 was a prime example of misuse of the JPEG format, so the whole scenario is a bit strange.

I'll get the planar cache fixed up so it can't error in situations like this, but I don't have time to look at it for a few days. For now you can either disable planar mode (MagicImageProcessor.EnablePlanarPipeline = false) or use a high-quality interpolator.

from photosauce.

neelabo avatar neelabo commented on May 30, 2024

(I am using Google Translate. I am sorry if the grammar is strange.)

As a precaution, I will report that similar phenomena are occurring in many JPEG other than sample images used in #6.

I have confirmed that the phenomenon will not occur in the way you suggested, so I will adopt this method for the time being.

Thank you.

from photosauce.

saucecontrol avatar saucecontrol commented on May 30, 2024

Wow, google translate is doing a great job :)

This problem will occur with any YCbrCr JPEG as long as the scaling ratio is less than 8:1. The problem is that the planar cache tracks the pixels consumed from each plane by incrementing a counter each time a line is read. The nearest neighbor interpolator doesn't sample all lines, so the counter doesn't keep an accurate position within the cache. It's not a difficult fix, just not an expected use-case. I appreciate your bug report, and I'll get a fix done shortly.

from photosauce.

saucecontrol avatar saucecontrol commented on May 30, 2024

Fixed in 6b72c16

from photosauce.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.