Code Monkey home page Code Monkey logo

Comments (5)

Cykooz avatar Cykooz commented on May 26, 2024 2

In version 2.0.0 I added PixelComponentMapper structure that allows you to create colorspace converters for images whose pixels based on u8 and u16 components.

Source and destination images for mapper may have different bit depth of one pixel component. But count of components must be equal. For example, you may convert U8x3 image with sRGB colorspace into U16x3 image with linear colorspace.

In addition, the crate contains functions create_gamma_22_mapper() and create_srgb_mapper() to create instance of PixelComponentMapper that converts images from sRGB or gamma 2.2 into linear colorspace and back.

You may use PixelComponentMapper to convert image colorspace before and after resizing.

from fast_image_resize.

Cykooz avatar Cykooz commented on May 26, 2024

The current implementation does nothing special with pixel components and knows nothing about color space of image.

The main feature of this crate is the use of SIMD instructions of CPU to speed up image resizing. So it is most likely not possible to simply use closures for pixel transforming. Because this will significantly slow down the resizing.

I'll can try to add support of images with u16 components of pixel (U16, U16x3 and U16x4). But I don't promise that I will do it soon.

from fast_image_resize.

virtualritz avatar virtualritz commented on May 26, 2024

It doesn't need to be closures. It can be something based on macros so users can have compile-time optimized paths for common encodings like sRGB or Adobe RGB.

Without this the the crate is useless for downscaling u8 component images that are non-linear (100% of u8 component images that are photos, textures etc., for obvious reasons) since the results will be wrong.

I would put a note in the README at least.

from fast_image_resize.

Cykooz avatar Cykooz commented on May 26, 2024

I've added support of U16x3 pixels. For now without optimizations using SIMD.

from fast_image_resize.

Cykooz avatar Cykooz commented on May 26, 2024

v0.8.0

  • Added optimisation for convolution of U16x3 images with helps of SSE4.1 and AVX2 instructions.

from fast_image_resize.

Related Issues (15)

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.