Git Product home page Git Product logo

Comments (4)

fintelia avatar fintelia commented on September 26, 2024 3

A bunch of places in this library require that pixels are an integer number of bytes, which would break for ImageLuma1.

However, that doesn't mean we cannot support Luma1 images for limited cases. We already have ExtendedColorType::L1 to describe the color type and the ImageDecoder::original_color_type method to reveal that a conversion is being applied. We've also been wanting to switch the ImageEncoder trait to allow passing any ExtendedColorType when writing image (while still allowing individual format encoders to reject color types they do not support). At that point, we'd be able to start adding Luma1 support to individual encoders

from image.

fosskers avatar fosskers commented on September 26, 2024

In the input image, we see (some fields redacted):

Geometry: 13244x71130+0+0
Channels: 2.0
Channel depth:
    Gray: 1-bit
Channel statistics:
    Pixels: 942045720
Colors: 2
Histogram:
      56641321: (0,0,0) #000000 gray(0)
     885404399: (255,255,255) #FFFFFF gray(255)
Filesize: 11.771MiB

while in the output image (processed by image) we see:

Geometry: 6904x37079+0+0
Channels: 2.0
Channel depth:
    Gray: 8-bit
Channel statistics:
    Pixels: 255993416
Colors: 256
Histogram:
  (many entries)
Filesize: 15.3349MiB

1/4 the number of pixels, yet a larger file size.

from image.

fintelia avatar fintelia commented on September 26, 2024

Update on this: as of the 0.25 release, ImageEncoder::encode now takes an ExtendedColorType. If anyone is interested in adding 1-bit grayscale support to any of our encoders, it should now be possible

from image.

fosskers avatar fosskers commented on September 26, 2024

Thanks for the update!

from image.

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.