Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WISH: add more getters/setter for image! type, not just RGB and ALPHA #2386

Open
Oldes opened this issue Sep 19, 2019 · 0 comments
Open

WISH: add more getters/setter for image! type, not just RGB and ALPHA #2386

Oldes opened this issue Sep 19, 2019 · 0 comments

Comments

@Oldes
Copy link

Oldes commented Sep 19, 2019

I often need to create image from foreign data and these data are usually not in two binaries which Rebol is now using to describe an image (RGB and ALPHA). I think that there should be possible to use this to get the binaries from an image:

i: make image! 1x1 i/1: 1.2.3.100
i/rgba ;== #{01020364}
i/rgbo ;== #{0102039B}
i/argb ;== #{64010203}
i/orgb ;== #{9B010203}
i/bgra ;== #{03020164}
i/bgro ;== #{0302019B}
i/abgr ;== #{64030201}
i/obgr ;== #{9B030201}
i/opacity ;== #{9B}
i/alpha   ;== #{64}

.. and also be able to set these. Now it is possible only with: i/rgb: #{050607}

Having also variant with premultiplied alpha would be also useful in many cases.

Oldes added a commit to Oldes/Rebol3 that referenced this issue Sep 23, 2019
implements: metaeducation/rebol-issues#2386

Could be optimized and enhanced later. For example it would be good to add also HSV, Hue, Saturation, Lightness etc. For these it would be good not to support only `binary!`, but also `vector!` as an input/output.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant