GithubHelp home page GithubHelp logo

BGR;15/16 scaling about pillow HOT 7 OPEN

Yay295 avatar Yay295 commented on May 25, 2024
BGR;15/16 scaling

from pillow.

Comments (7)

radarhere avatar radarhere commented on May 25, 2024 2

These modes aren't actually used by any image format (the rawmodes are, but not the modes). So a discussion about how they should behave is just about consistency with how the rest of Pillow behaves.

But speaking of the fact that they aren't used

  • Support for creating images with these modes was added in #7010 in Pillow 9.5.0 in response to #6769 (comment).
  • Support for access for these modes was added in #7303 in Pillow 10.1.0 to help #7209 and #7260

If your goal is to progressively ensure that all Pillow operations are supported for all modes, I don't think building out support for them in a test-driven development fashion is a worthwhile endeavour if there's no evidence that they would be used.

I'm more in favour of the idea from #2228 of just removing BGR;15, BGR;16 and BGR;24 as modes entirely.

from pillow.

Yay295 avatar Yay295 commented on May 25, 2024

I agree with removing them, but I think that will require a deprecation period. Slightly changing how they work doesn't require a deprecation period, so it could be done at the same time.

from pillow.

Yay295 avatar Yay295 commented on May 25, 2024

Also, the two converters changed in #7972 should be added as packers. There's not really any difference between a packer, an unpacker, and a converter, so they could all be grouped into one list.

from pillow.

radarhere avatar radarhere commented on May 25, 2024

I've created #7978 to deprecate them.

Slightly changing how they work doesn't require a deprecation period, so it could be done at the same time.

The modes are currently supported for image creation, converting to the mode, access, unpacking and putdata(). There's no way to use the final image result for these modes except by getting the pixel values. So if you're using these modes, and then you find the scale of the pixel values returned is different, you have to rewrite your code.

Introducing a breaking change to a feature at the same time as deprecating it seems counterproductive.

Also, the two converters changed in #7972 should be added as packers. There's not really any difference between a packer, an unpacker, and a converter, so they could all be grouped into one list.

I don't see anything special about converting RGB to BGR;15 or BGR;16 that means we need packers for them specifically. If you want to restructure packers, unpackers and converters in general, then I suggest you start a new conversation about that.

from pillow.

Yay295 avatar Yay295 commented on May 25, 2024

How does packing work without a packer? There is currently a packer from BGR;15/16 to BGR;15/16, but there is not a packer from RGB to BGR;15/16. There already are unpackers from BGR;15/16 to RGB.

from pillow.

radarhere avatar radarhere commented on May 25, 2024

How does packing work without a packer?

You think that Pillow is currently packing without a packer, for some scenario? Could you provide an example of that scenario?

There is currently a packer from BGR;15/16 to BGR;15/16,

Yes.

but there is not a packer from RGB to BGR;15/16.

...so? I don't see how that contradicts anything, or why there would have to be at the moment.

There already are unpackers from BGR;15/16 to RGB.

Yes.

I think you're drifting off-topic from BGR;* scaling, and this would be better asked in a new conversation.

from pillow.

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.