Read and rotate transparent or intransparent image

Read and rotate transparent or intransparent image. Output is the rotated image as RGB data and the transparency data alpha. No toolbox!

이 제출물을 팔로우합니다

Rotateim.m
This function reads an (transparent) image and rotates it by theta degrees.
Features
  • No toolbox required
  • Read and rotate transparent/intransparent image
  • Scale image size up/down
  • Crop
Syntax
[imR,alphaR] = rotim(im,theta,bgColor,crop,scale,interpMethod)
INPUT:
im: a) image file name
b) struct with two fields, im.rgb image and im.alpha
im.rgb: height * width * (1 or 3), either 0-255 uint8 or 0-1 double
im.alpha: height * width, either 0-255 uint8 or 0-1 double
theta: Amount of rotation in degrees
bgColor: Color of the given background.
Optional, place holder: NaN
Default: [128, 128, 128]
Integer numbers in the range 0-255
Example: [255 255 0] for yellow
Color of some pixels at the opaque border of the rotated small image.
Those pixels come up by rotating the small image, especially visible with very small
images.
Perfect result is when S.’bgColor’ is the same RGB color as the background.
crop: crop image. Optional, default: no crop
true: crop transparent areas
false: no crop, default
scale: a scalar factor that scales (shrinks or enlarges) the image. Optional, default=1, no scaling
No antialiasing is invoked by changing the scale
interpMethod:
'nearest' - nearest neighbor interpolation, sometimes better for very small images
'linear' - bilinear interpolation (default), recommended
'cubic' - bicubic interpolation
OUTPUT:
imR: Rotated image as RGB values
alphaR: Rotated transparency
Remark:
To increase speed at multiple calls of rotim, some data is stored as peristent data.
Therefore, when the image content has changed, but not the image name, call
imrot without any argument to reset persistent data.
Example:
imshow(rotim('corn.tif',33))
See also enclosed "readMeRotateIm.pd"'.

인용 양식

Peter Seibold (2026). Read and rotate transparent or intransparent image (https://kr.mathworks.com/matlabcentral/fileexchange/180599-read-and-rotate-transparent-or-intransparent-image), MATLAB Central File Exchange. 검색 날짜: .

일반 정보

MATLAB 릴리스 호환 정보

  • 모든 릴리스와 호환

플랫폼 호환성

  • Windows
  • macOS
  • Linux
버전 퍼블리시됨 릴리스 정보 Action
1.0.2

Update of summary.

1.0.1

Updated descriptiom

1.0.0