POV-Ray : Newsgroups : povray.general : Determining the size of a picture : Re: Determining the size of a picture Server Time
1 Aug 2024 12:19:31 EDT (-0400)
  Re: Determining the size of a picture  
From: Chris B
Date: 7 Oct 2005 08:41:15
Message: <43466ceb@news.povray.org>
"Rick Measham" <rickm*at%isite.net.au> wrote in message 
news:434475e4$1@news.povray.org...
>I want to create a simple 'picture frame' macro that will take an image
> file as its parameter and return a nicely framed picture, however I
> can't see any way to get the size of the picture, they're resized to 1pu
> x 1pu.
>
> Is there any way to do this? Or do I need to specify the size in my
> parameters?
>
> Cheers!
> Rick Measham

Here's a macro to do it. It scans the centre lines of the image looking for 
the smallest dot it can find, so it can make mistakes with some images if 
they're made up of large blocks of color, ie if the centre lines don't hit a 
pixel sized color change.

To change the image type you'll need to update the macro, as I couldn't get 
it to work as a variable. It's currently set to 'jpeg'. For bmp use 'sys'.
Takes about a second to scan a 640x480 image.

Hope it's useful,

Regards,
Chris B.


Post a reply to this message


Attachments:
Download 'detectimagesize.pov.txt' (4 KB)

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.