imresizep

by Tim C. Lueth, SG-Lib Toolbox: SolidGeometry 5.6 - Images
Introduced first in SolidGeometry 4.3, Creation date: 2018-10-13, Last change: 2025-09-14

resizes an image proportional relative to a mimum number of pixels

Description

This function is used to limit an image size before image processing to guarantee a defined processing time. The image is always scaled proportionally.
It is possible to scale on maximum value for row or col, or on defined rows number, defined cols number or defined size. If there is need to add a border, since the given format differenz from the original images's proportion, a color can specified for the border;

See Also: imreadui

Example Illustration

 missing image of imresizep(I,maxrc,defcol)

Syntax

I=imresizep(I,maxrc,[defcol])

Input Parameter

I: Images
maxrc: maximum number of rows or cols; or [rw nan] or [nan col];
defcol: color for borders to extend; default is 255

Output Parameter

I: resized image smaller than [maxrc x maxrc]

Examples


I=imread('peppers.png'); whos I
imresizep(I,480); pause
imresizep(I,[nan 1080]);pause
imresizep(I,[1080 nan]);
pause; imresizep(I,[700 2000],255);
pause; imresizep(I,[2000 700],100);




Copyright 2018-2025 Tim C. Lueth. All rights reserved. The code is the property of Tim C. Lueth and may not be redistributed or modified without explicit written permission. This software may be used free of charge for academic research and teaching purposes only. Commercial use, redistribution, modification, or reverse engineering is strictly prohibited. Access to source code is restricted and granted only under specific agreements. For licensing inquiries or commercial use, please contact: Tim C. Lueth

Last html export of this page out of FM database by TL: 2025-09-21