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

HSV saving broken #41

Closed
rsrock opened this issue Jun 19, 2017 · 3 comments
Closed

HSV saving broken #41

rsrock opened this issue Jun 19, 2017 · 3 comments

Comments

@rsrock
Copy link
Contributor

rsrock commented Jun 19, 2017

Something is up recently with HSV saving. This block, extracted from the tests, illustrates the problem.

julia> using Base.Test, FileIO, QuartzImageIO, ColorTypes

julia> using FixedPointNumbers, TestImages, ImageAxes
using Images  # For ImageMeta

julia> using Images  # For ImageMeta

julia> using OffsetArrays

julia> srand(42)
MersenneTwister(UInt32[0x0000002a], Base.dSFMT.DSFMT_state(Int32[964434469, 1073036706, 1860149520, 1073503458, 1687169063, 1073083486, -399267803, 1072983952, -909620556, 1072836235  …  -293054293, 1073002412, -1300127419, 1073642642, 1917177374, -666058738, -337596527, 1830741494, 382, 0]), [1.49883, 1.32935, 1.22115, 1.93464, 1.89353, 1.95906, 1.58691, 1.8118, 1.09687, 1.35367  …  1.02514, 1.25471, 1.31046, 1.06786, 1.97371, 1.41167, 1.01982, 1.3229, 1.21062, 1.11614], 382)

julia> img = rand(HSV{Float32}, 8, 10)

[An expected random image, thanks to TerminaExtensions.jl]

julia> mydir = tempdir() * "/QuartzImages"

julia> out_name = joinpath(mydir, "hsv.png")

julia> save(out_name, img)
329

julia> oimg = load(out_name)

[An unexpected, very red image with similar intensity pattern as img]

julia> img[1]
HSV{Float32}(31.096245f0,0.63024366f0,0.9028468f0)

julia> HSV.(oimg)[1]
HSV{Float32}(1.2413793f0,0.6304348f0,0.9019608f0)

Notice the hue value in img[1] vs. the converted oimg[1].

Question: is there anything that changed recently that would affect the hue value alone in HSV images? I'm guessing something similar is happening with HSL and Lab images, because both of those tests fail too. Pinging @timholy

@timholy
Copy link
Member

timholy commented Jun 19, 2017

Just to check, you don't get the red image from RGB.(img), right? I would consider descending into the save implementation. If you can reproduce this on 0.5, you might consider Gallium. Or just decorate the various functions in the expected call chain with @show first(img) or something.

@timholy
Copy link
Member

timholy commented Jun 19, 2017

It's also possible it was JuliaIO/FileIO.jl#131. See if JuliaIO/FileIO.jl#136 fixes it?

@rsrock
Copy link
Contributor Author

rsrock commented Jun 19, 2017

Yes, it looks like this is JuliaIO/FileIO.jl#131.

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