Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
A faster way to scale images?
#2
One thing you need to determine to begin with is to decide if scaling is the bottleneck in your performance, or if it's just a case of the larger image sizes.  Keep in mind that an image 2x the size uses 4x the memory and processing power.  An image 3x the original size used 9x the memory and processing power.

For example, let's take a simple 10x10 pixel image and scale it by a factor of 3.  That's now a 30x30 pixel image, for a total of 900 pixels to process, compared to the 100 the original picture had.

If you're certain the scaling is the issue and that's what's bottlenecking your performance, then simply prescale your images.

INPUT "How much do you want to scale  your image?  "; scale%
scaledImage = _NEWIMAGE(_width(originalImage)* scale%, _height(originalImage) * scale%, 32)
_PUTIMAGE ,originalImage, scaledimage

^Now you have the image prescaled and can just _PUTIMAGE the contents to the screen without having to constantly resize on the fly.  Smile
Reply


Messages In This Thread
A faster way to scale images? - by johannhowitzer - 01-31-2023, 02:14 PM
RE: A faster way to scale images? - by SMcNeill - 01-31-2023, 02:46 PM
RE: A faster way to scale images? - by SMcNeill - 02-01-2023, 02:07 PM
RE: A faster way to scale images? - by SMcNeill - 02-13-2023, 01:30 PM
RE: A faster way to scale images? - by SMcNeill - 02-15-2023, 05:27 PM
RE: A faster way to scale images? - by SMcNeill - 02-16-2023, 07:39 PM



Users browsing this thread: 4 Guest(s)