Imrotate won't fill when called

I’m trying to use imrotate with control of fill values from ImageTransformations.jl. This has a couple of prerequisites for use, namely Interpolations.jl to permit filling of values other than NaN

using Images
using Interpolations

I then try to rotate an image:

b = ones(20,20)
c = imrotate(b, 1, axes(b); fill=0.0)
julia>     c = imrotate(b, 1, axes(b); fill=0.0)
20×20 Array{Float64,2}:
 NaN  NaN  NaN  NaN    NaN    NaN    NaN    1.0  1.0  1.0  1.0  1.0  1.0    1.0    1.0  NaN    NaN    NaN  NaN  NaN
 NaN  NaN  NaN  NaN    NaN    NaN      1.0  1.0  1.0  1.0  1.0  1.0  1.0    1.0    1.0    1.0  NaN    NaN  NaN  NaN
 NaN  NaN  NaN  NaN      1.0    1.0    1.0  1.0  1.0  1.0  1.0  1.0  1.0    1.0    1.0    1.0  NaN    NaN  NaN  NaN
 NaN  NaN  NaN    1.0    1.0    1.0    1.0  1.0  1.0  1.0  1.0  1.0  1.0    1.0    1.0    1.0    1.0  NaN  NaN  NaN
   ⋮                            ⋮                          ⋮                              ⋮
 NaN  NaN  NaN  NaN      1.0    1.0    1.0  1.0  1.0  1.0  1.0  1.0  1.0    1.0    1.0    1.0  NaN    NaN  NaN  NaN
 NaN  NaN  NaN  NaN      1.0    1.0    1.0  1.0  1.0  1.0  1.0  1.0  1.0    1.0  NaN    NaN    NaN    NaN  NaN  NaN
 NaN  NaN  NaN  NaN    NaN      1.0    1.0  1.0  1.0  1.0  1.0  1.0  1.0  NaN    NaN    NaN    NaN    NaN  NaN  NaN

Clearly the NaNs aren’t supposed to be here. What am I doing wrong? I’ve also tried fillvalues=0.0 to no effect.

1 Like

Rookie mistake. I’ve been reading the documentation wrong: Remove the keyword and all is right with the world.

begin
	rot = imrotate(smaller, 4 * π / 180, RGB(0.0, 0.0, 0.75))
	rot
end

Knew it had to be something simple like that. This works!