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

Add logo for document #63

Closed
hyrodium opened this issue May 29, 2021 · 2 comments
Closed

Add logo for document #63

hyrodium opened this issue May 29, 2021 · 2 comments

Comments

@hyrodium
Copy link
Contributor

Hi! i'm now planning to add logo images to ImageDraw.jl.

logo
logo-dark

image
image

using Images, ImageDraw

# original image
img = load(download("https://raw.githubusercontent.com/JuliaImages/juliaimages.github.io/source/docs/src/assets/logo.png"))

# Define some colors
c_r, c_g, c_b, c_p = RGBA.([Colors.JULIA_LOGO_COLORS...])
gray_dark = RGBA{N0f8}(0.1,0.1,0.1)
gray_light = RGBA{N0f8}(0.9,0.9,0.9)

# change base corlor black to gray
img = img*N0f8(0.5) .+ RGBA{N0f8}(0.5,0.5,0.5,0)
img_dark = copy(img)
img_light = copy(img)

# define points on the image
p_green = Point(87,35)
p_red = Point(75,55)
p_purple = Point(99,55)
p1 = Point(13,96)
p2 = Point(52,50)
p3 = Point(73,73)
p4 = Point(84,62)
p5 = Point(116,97)

for (img,gray,name) in ((img_dark,gray_light,"logo-dark.png"), (img_light,gray_dark,"logo.png"))
    draw!(img, LineTwoPoints(p1,p2), gray)
    draw!(img, LineTwoPoints(p2,p3), gray)
    draw!(img, LineTwoPoints(p3,p4), gray)
    draw!(img, LineTwoPoints(p4,p5), gray)

    draw!(img, Cross(p1,8), gray)
    draw!(img, Cross(p2,8), gray)
    draw!(img, Cross(p3,8), gray)
    draw!(img, Cross(p4,8), gray)
    draw!(img, Cross(p5,8), gray)

    draw!(img, Ellipse(CirclePointRadius(p_green,10)), c_g)
    draw!(img, Ellipse(CirclePointRadius(p_red,10)), c_r)
    draw!(img, Ellipse(CirclePointRadius(p_purple,10)), c_p)

    save(name,img)
end

Do you have any comments?

@hyrodium hyrodium changed the title Add logo fro document Add logo for document May 29, 2021
@johnnychen94
Copy link
Member

👍 looks good to me

@hyrodium
Copy link
Contributor Author

The PR is merged, so I'll close this issue.

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

2 participants