The key line in the error message is "out-of-range values": if you're using 
`Float64`, black corresponds to 0.0 and white corresponds to 1.0. It's 
alerting you that some of your values went outside that range. If it didn't 
alert you to this problem in some way, then you'd wonder "how come I had this 
nice image but when I saved it and loaded the file, it was all white?" (or all 
black?)

If you read the message carefully, it's also telling you how to avoid this 
problem:
       map(Images.Clamp01NaN(img), img)
where `img` is your array. This function will clamp all values to between 0 
and 1, even if your image contains NaN values.

Best,
--Tim

On Thursday, April 28, 2016 09:46:27 AM [email protected] wrote:
> Hello all,
> 
> I'm trying to save PNG images of the mandelbrot set.
> So, I've been using the package Images to do so.
> 
> To get a grip around how the package works, I've decided to test out the
> function "save".
> I've given it a filename to save in and a random two-dimensional array of
> Float64s (Array{Float64, 2})
> However, it did not work.
> 
> I keep getting the following error:
> WARNING: Mapping to the storage type failed; perhaps your data had
> out-of-range values?
> Try `map(Images.Clamp01NaN(img), img)` to clamp values to a valid range.
> WARNING:
> MethodError(Images.MapNone{FixedPointNumbers.UFixed{UInt8,8}}(),(0.659231238
> 8568704,)) [inlined code] from .\number.jl:54
> 
> I don't really understand why this is happening.
> I'm currently using Julia 0.5.0-dev+3731.
> I've tried doing it in Julia 0.4.5, but it still doesn't work.
> 
> Is this issue common? Or is it just on my machine?
> Regardless, what do I need to do to get this issue resolved?
> 
> 
> Thank you,
> Yousef

Reply via email to