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

Semi-transparent shapes and automatic flood fill. #77

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

norpadon
Copy link

Add an option to make drawn shapes semi-transparent by specifying a keyword argument opacity, like this:

ImageDraw.draw!(image, ImageDraw.Cross(ImageDraw.Point(x, y), 3), color, opacity=0.2)

Also change the polygon filling API. Now you don't need to pass any objects containing seed coordinates, just specify keyword arguments fill_color and fill_opacity:

ImageDraw.draw(keypoint_vis, rectangle, RGBA{Float64}(1, 0, 0), opacity=1.0, fill_color=RGBA{Float64}(0, 1, 0), fill_opacity=0.5)

keypoint_vis

@johnnychen94
Copy link
Member

johnnychen94 commented Sep 28, 2023

The new feature looks pretty nice!

This PR introduces a few breaking things, I insist you trying both of the following before merging:

  • use @deprecate and Base.depwarn to properly handle methods/types that could still be supported in a compatible way. For deprecation, This is a good reference if you've never done such kind of thing before.
  • introduce a good changelog.md file to let future users what's breaking, the rational, and the suggested steps to migrate. Documenter.jl does this really really well.

@Sixzero
Copy link

Sixzero commented Jan 18, 2024

I would like to know why is it good to introduce the flag opacity, instead of using RGBA{N0f8}(1.,0,0,0.4) for 40% opacity? I mean if the color already defines the opacity, then why define it in the function call?

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

Successfully merging this pull request may close these issues.

3 participants