-
-
Notifications
You must be signed in to change notification settings - Fork 5.7k
Closed
Description
Does anyone happen to know which PR likely fixed this, and whether it's backportable? I can do a bisect if it would be helpful.
julia> using Images
julia> input = Matrix{RGB{N0f8}}(undef, 5, 5);
julia> fill!(input, RGB(0, 0, 0));
julia> useother = trues(size(input));
julia> function transfermask(input, useother, othervalue)
combined = similar(input)
for idx in eachindex(combined)
combined[idx] = ifelse(
useother[idx],
RGB{Float64}(othervalue),
input[idx]
)
end
return combined
end
transfermask (generic function with 1 method)Buggy result (at least julia 1.0.5 and julia 1.2.0, maybe others):
julia> transfermask(input, useother, RGB{N0f8}(1.0,1.0,1.0))
5×5 Array{RGB{N0f8},2} with eltype RGB{Normed{UInt8,8}}:
RGB{N0f8}(1.0,0.0,0.0) RGB{N0f8}(1.0,0.0,0.0) RGB{N0f8}(1.0,0.0,0.0) RGB{N0f8}(1.0,0.0,0.0) RGB{N0f8}(1.0,0.0,0.0)
RGB{N0f8}(1.0,0.0,0.0) RGB{N0f8}(1.0,0.0,0.0) RGB{N0f8}(1.0,0.0,0.0) RGB{N0f8}(1.0,0.0,0.0) RGB{N0f8}(1.0,0.0,0.0)
RGB{N0f8}(1.0,0.0,0.0) RGB{N0f8}(1.0,0.0,0.0) RGB{N0f8}(1.0,0.0,0.0) RGB{N0f8}(1.0,0.0,0.0) RGB{N0f8}(1.0,0.0,0.0)
RGB{N0f8}(1.0,0.0,0.0) RGB{N0f8}(1.0,0.0,0.0) RGB{N0f8}(1.0,0.0,0.0) RGB{N0f8}(1.0,0.0,0.0) RGB{N0f8}(1.0,0.0,0.0)
RGB{N0f8}(1.0,0.0,0.0) RGB{N0f8}(1.0,0.0,0.0) RGB{N0f8}(1.0,0.0,0.0) RGB{N0f8}(1.0,0.0,0.0) RGB{N0f8}(1.0,0.0,0.0)Correct result (at least 1.3.1 and master, maybe others):
julia> transfermask(input, useother, RGB{N0f8}(1.0,1.0,1.0))
5×5 Array{RGB{N0f8},2} with eltype RGB{Normed{UInt8,8}}:
RGB{N0f8}(1.0,1.0,1.0) RGB{N0f8}(1.0,1.0,1.0) RGB{N0f8}(1.0,1.0,1.0) RGB{N0f8}(1.0,1.0,1.0) RGB{N0f8}(1.0,1.0,1.0)
RGB{N0f8}(1.0,1.0,1.0) RGB{N0f8}(1.0,1.0,1.0) RGB{N0f8}(1.0,1.0,1.0) RGB{N0f8}(1.0,1.0,1.0) RGB{N0f8}(1.0,1.0,1.0)
RGB{N0f8}(1.0,1.0,1.0) RGB{N0f8}(1.0,1.0,1.0) RGB{N0f8}(1.0,1.0,1.0) RGB{N0f8}(1.0,1.0,1.0) RGB{N0f8}(1.0,1.0,1.0)
RGB{N0f8}(1.0,1.0,1.0) RGB{N0f8}(1.0,1.0,1.0) RGB{N0f8}(1.0,1.0,1.0) RGB{N0f8}(1.0,1.0,1.0) RGB{N0f8}(1.0,1.0,1.0)
RGB{N0f8}(1.0,1.0,1.0) RGB{N0f8}(1.0,1.0,1.0) RGB{N0f8}(1.0,1.0,1.0) RGB{N0f8}(1.0,1.0,1.0) RGB{N0f8}(1.0,1.0,1.0)johnnychen94 and stevengj
Metadata
Metadata
Assignees
Labels
No labels