Jump to content

angusj

Members
  • Content Count

    132
  • Joined

  • Last visited

  • Days Won

    8

angusj last won the day on April 24 2023

angusj had the most liked content!

Community Reputation

126 Excellent

3 Followers

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

  1. It's a problem with the Graphics32 library too if TAffineTransformation is used to do the scaling.
  2. If you avoid using TAffineTransformation, and just use a resampler together with a renderer, then you do avoid this issue with pixelation. (In my Image32 graphics library, I use affine transformations without a renderer.)
  3. I've just had another look at resampling and specifically downsampling, and I'm back to my starting assertion that box downsampling does produce better quality images than general purpose resampling algorithms. However, I will concede that, because these downsampled images are generally much smaller, it's usually difficult to spot these differences. For example: This is the fruit image from above that has been resized to 1/3 original using a bicubic resampler: This is the fruit image from above that has been resized to 1/3 original using a box downsampler: Yes, it's hard to spot the differences unless you compare them with a decent image editor (or just zoom in using your web browser). Yet here's a more extreme example of downsampling (scaled to 0.1 of original size) where the quality differences are very noticeable: Bicubic kernel resampler: Box downsampler: Original image: And this does make sense when you understand the differences between these algorithms. Consider downsampling an image to 1/3 its size (where each 3 x 3 grid of pixels will merge into a single pixel) ... box downsampling will weigh every pixel equally in each 3 x 3 grid; whereas general purpose kernel resamplers will heavily weight pixels that are closer to the middle of these 3 x 3 grids.
  4. Indeed, Octree does have significant limitations just as you've illustrated above. Anyhow, here's the image reduced to 16 colors using (a slightly modified) median cut ...
  5. Yes, several bugs needed fixing which I've done and just uploaded. And I'm expecting you'll find a few more 😱. Anyhow, thanks 😁.
  6. This link to the Color Quantization unit in my own Delphi Graphics Library may also be useful to you. The code there should be quite easy to adapt to Graphics32.
  7. angusj

    Versioning in my program

    https://www.angusj.com/delphitips/getversion.php
  8. MSVS does even better that that, it also suggests how to improve your code. (Well it does for me, but perhaps not for you if your code can't be improved 😜.) Over almost 30yrs, I've written a lot of very useful (ie reuseable) Delphi code, otherwise I would have ditched Delphi years ago.
  9. angusj

    User Drawing of Lines and Curves

    https://stackoverflow.com/questions/24789766/drawing-a-bezier-curve-using-firemonkey
  10. If you're only searching by filename or file type (*.jpg;*.png; etc) then the filesystem would suffice.
  11. LOL 🤣. The pages perhaps are "cooked" but it wasn't intentional. Anyhow, I've just done a number of followup tests and I'll concede that I can't spot the difference between all 3 renderers when downsampling various images. I'm surprised and I'll need to refresh myself on the differences between these resamplers.
  12. Looking at the image in the OP, it looks like FMX is using a nearest neighbour resampler, which is fast but poor quality. Certainly a bilinear or bicubic resampler would be much better, but for down sampling specifically, a BoxDownSampling resampler would be better still.
  13. angusj

    VCL-Bitmap rescaler

    Yep, point taken.
  14. angusj

    VCL-Bitmap rescaler

    Or you could make the bitshifting explicit : inc(Cache.b, (ps.rgbBlue*alpha) shr 2); And given that you're multiplying two bytes you could optimise this further by using a lookup table: MulTable: array [Byte,Byte] of integer; //initialized in initialization section ... inc(Cache.b, MulTable[ps.rgbBlue, alpha] shr 2); Edit: Oops, sorry, it appears that alpha is an integer, not a byte.
  15. angusj

    VCL-Bitmap rescaler

    4 😁 Edit: Perhaps it just means re-star-ting? Edit2: It's very easy to rename a repository (via Settings) and you won't lose any stars!
×