Re: Resize algorithm implemented in GDI



4N wrote:
Hi,
does someone know what resize algorithm stretchBlt (using HALFTONE option) uses to shrink images?
I used every known interpolant filter I know in the spacial domain and none of them reaches its sharpness so I'm starting to think it's a filter working in the frequency domain...


It looks like a trivial nearest neighbour algorithm (it doesn't increase number of colors in the resized image). It explains it sharpness as well as it's low quality (take any 256 color image and resize it to see how really terrible this algorithm is).

--
Grzegorz Wróbel
http://www.4neurons.com/
677265676F727940346E6575726F6E732E636F6D

.



Relevant Pages

  • Re: barcode
    ... The same algorithm I used in an ASP page and it worked. ... If you want to generate CODE 39, POSTNET, i25 barcodes: ... For the 250 to 290 that means 40 extra pixels ... , if it gives it to the printer to resize ...
    (comp.lang.php)
  • Image scaling by Width & Height constant - preserve aspect ratio
    ... I'm looking for an algorithm to resize an image of arbitrary size to a ... until less than or equal to 440 x 780 and preserve aspect ratio. ... Farce ...
    (comp.lang.java)
  • How to modify size of dialog while in OnSize()?
    ... ratio. ... I can run my algorithm in the OnSizeto determine the correct size ... while in OnSize(), OnSizeis called again and I'm in an infinite loop. ... wait for the mouse button to be released and then resize, ...
    (microsoft.public.vc.mfc)
  • Re: How to modify size of dialog while in OnSize()?
    ... > ratio. ... I can run my algorithm in the OnSizeto determine the correct ... > while in OnSize(), OnSizeis called again and I'm in an infinite loop. ... > wait for the mouse button to be released and then resize, ...
    (microsoft.public.vc.mfc)