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

Alpha not working in Imager 0.99 [rt.cpan.org #97404] #418

Open
tonycoz opened this issue Dec 20, 2020 · 0 comments
Open

Alpha not working in Imager 0.99 [rt.cpan.org #97404] #418

tonycoz opened this issue Dec 20, 2020 · 0 comments

Comments

@tonycoz
Copy link
Owner

tonycoz commented Dec 20, 2020

Migrated from rt.cpan.org#97404 (status was 'open')

Requestors:

Attachments:

From jt@plainblack.com on 2014-07-22 15:40:15
:

I tried getting alpha transparencies working following the instructions here: http://imager.perl.org/docs/Imager/Color.html

However, no matter what I do, the alpha channel doesn�t seem to work. I may be doing something wrong, or it may be broken. I thought I should report it to find out.

I�ve attached some sample code and a sample output image.




From tonyc@cpan.org on 2014-07-24 13:21:44
:

On Tue Jul 22 11:40:15 2014, jt@plainblack.com wrote:
> I tried getting alpha transparencies working following the
> instructions here: http://imager.perl.org/docs/Imager/Color.html
> 
> However, no matter what I do, the alpha channel doesn�t seem to work.
> I may be doing something wrong, or it may be broken. I thought I
> should report it to find out.
> 
> I�ve attached some sample code and a sample output image.

It's more a missing feature.

By default, box(), and most other methods, replace the underlying pixel rather than combining with it.

If you sample had used a 4 channel image, the blue part of the image would have been translucent.

This is something I plan to change, someday, but there are other issues I want to fix first.

You can use fill objects (and Imager's shortcut for fill objects) to do transparent fills:

  $image->box(fill => { solid => $color, combine => "normal" },
              xmin => 150, ymin => 150, xmax => 250, ymax => 250)
      or die $image->errstr;

Note that setting "filled" to non-zero as you did causes the "fill" parameter to be ignored.

Tony

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant