Skip to content

Instantly share code, notes, and snippets.

@mschauer
Created April 14, 2021 14:57
Show Gist options
  • Select an option

  • Save mschauer/6e1977a5282686513f5f7eb19d9331dd to your computer and use it in GitHub Desktop.

Select an option

Save mschauer/6e1977a5282686513f5f7eb19d9331dd to your computer and use it in GitHub Desktop.
Calibration test image for Makie
using Makie
using Colors
n = 100
f(x) = 0.5 .*reim(((x[1] + x[2]*im)/33)^2)
function f2(x)
0.5.*abs(2*(x[1] + x[2]*im)/1089)
end
#f(x) = (x[1],x[2])
#f2(x) = 1.0
αs = vec(CartesianIndices((n,n)))
βs = (f.(αs))
Δ = [f2(α) for α in αs]
γ = (1-pi/4)
fig, ax, plot = scatter(first.(βs), last.(βs), markersize=Δ, color=:black, strokewidth=0, markerspace=SceneSpace)
ax.aspect=DataAspect()
lines!([1.2, 1.2], [0, 15], linewidth=50, color=RGB(γ, γ, γ))
@mschauer

Copy link
Copy Markdown
Author

The true value for the aliased grey should be #373737 or grey(1-pi/4) , because the image is a distorted square circle packing and each disk covers pi/4 of a square

@mschauer

Copy link
Copy Markdown
Author

Screenshot 2021-04-14 at 17 02 13

@mschauer

Copy link
Copy Markdown
Author

makietestimage

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