Code Monkey home page Code Monkey logo

Comments (10)

Cykooz avatar Cykooz commented on May 26, 2024

The original image contains Display P3 color profile. The result image doesn't contain it.
The fast_image_resize knows nothing about color profiles or color spaces. It works with raw pixel values.
If you want to get correct colors, you should at least add the color profile from the source image-file into the result image-file.
Ideally, you should convert the source pixels to a linear color space before resizing, and convert them back after resizing (read more)

from fast_image_resize.

Kevin301099 avatar Kevin301099 commented on May 26, 2024

can you suggest library for do this ?

from fast_image_resize.

Cykooz avatar Cykooz commented on May 26, 2024

Honestly, I don't see any difference in the color of these images on my computer.

from fast_image_resize.

Cykooz avatar Cykooz commented on May 26, 2024

But I see that you used Nearest algorithm to resize the image.
That is the result of using Convolution(Filter::Lanczos3) algorithm:
4-res

from fast_image_resize.

Cykooz avatar Cykooz commented on May 26, 2024

And if you also resize the image in linear color space (with mapper that may be created with help of create_srgb_mapper()), the result in dark areas will be even better (look at the grass under the bull):
3-res

from fast_image_resize.

Cykooz avatar Cykooz commented on May 26, 2024
  1. Your result with Nearest algorithm
  2. Resize with Convolution algorithm in sRGB color space
  3. Resize with Convolution algorithm in linear color space
    res

from fast_image_resize.

Cykooz avatar Cykooz commented on May 26, 2024

I opened the original image in my browser and now I see the color difference. I think my default image viewer doesn't support color profiles. And that's the reason why I didn't see the difference at first.

from fast_image_resize.

Cykooz avatar Cykooz commented on May 26, 2024

can you suggest library for do this ?

Sorry, I can't suggest any library right now. I haven't had to work with color profiles yet.

from fast_image_resize.

Kevin301099 avatar Kevin301099 commented on May 26, 2024

ok, thank you.

from fast_image_resize.

Cykooz avatar Cykooz commented on May 26, 2024

The first crate I found on google was https://github.com/kornelski/rust-lcms2.

from fast_image_resize.

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.