File Exchange

image thumbnail

Fill corners of rotated image

version 1.5 (3.33 KB) by

Rotate image without making black edges.

6 Ratings



View License

ROIROTATE was designed to avoid the 'black corners' typical of MATLAB's imrotate function, which are apearing from its behaviour of padding by zeros of the space outside the image borders prior to the rotation. This is possible if the image to be rotated is part of a bigger image, because there is enough information to fill the corners.

Comments and Ratings (7)


hend (view profile)

amir yavari

great job tnx

Mohsen Jamali

thanks a lot

Husam Aldahiyat

Vlad Atanasiu

Vlad Atanasiu (view profile)

Bug removed. Thanks Mathew!


Great, but there is one small but important bug! When calculating the padding, it doesn't convert from degrees to radians, which means that occasionally it will not pad the images enough. Just make sure you edit the padX and padY variables and it will work beautifully!

Elwyn Jenkins




Published as Matlab toolbox (.mltbx file).


Degrees are now converted to radians before image processing.

MATLAB Release
MATLAB 6.1 (R12.1)

Download apps, toolboxes, and other File Exchange content using Add-On Explorer in MATLAB.

» Watch video

Win prizes and improve your MATLAB skills

Play today