I'm currently trying to improve my image resizing algorithm. First, I re-size the picture's height and width by 50%. If the new width and height is > max_width and max_height, I set the thumbnail's width to max_width and the height to max_height.
Obviously this will create very poor quality thumbnails of my images.
What could I do to improve this process?
Name:
Anonymous2011-12-21 7:32
>>1
Whoops, I meant to say "will occasionally create poor quality thumbnails."
Divide the image's width by its height to get the aspect ratio. If this number is less than the aspect ratio of your maximum dimensions, divide 1 by it and swap width and height in the rest of this algorithm. Multiply your maximum width with this ratio to get the new height. Resize the image to the maximum height and the new width.
uiueo@eee ~ $ calc
C-style arbitrary precision calculator (version 2.12.1.5)
Calc is open software. For license details type: help copyright
[Type "exit" to exit, or "help" for help.]
It is easily seen that the only numbers between 0 and 2, including 0 but excluding 2, are 0 and 1. Thus the remainder left by any number on division by 2 is either 0 or 1. Hence the quotient ring Z/2Z, where 2Z is the ideal in Z generated by 2, has only the elements [0] and [1], where these are the images of 0 and 1 under the canonical quotient map. Since [1] must be the unit of this ring, every element of this ring except [0] is a unit, and the ring is a field