POV-Ray : Newsgroups : povray.general : Determining the size of a picture Server Time
29 Nov 2024 13:46:47 EST (-0500)
  Determining the size of a picture (Message 1 to 10 of 10)  
From: Rick Measham
Subject: Determining the size of a picture
Date: 5 Oct 2005 20:55:00
Message: <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


Post a reply to this message

From: Warp
Subject: Re: Determining the size of a picture
Date: 6 Oct 2005 02:30:14
Message: <4344c476@news.povray.org>
Rick Measham <rickm*at%isite.net.au> wrote:
> Is there any way to do this?

  Not with the current povray.

> Or do I need to specify the size in my parameters?

  That's probably the only way.

-- 
                                                          - Warp


Post a reply to this message

From: Marc Jacquier
Subject: Re: Determining the size of a picture
Date: 6 Oct 2005 05:21:47
Message: <4344ecab$1@news.povray.org>

news:4344c476@news.povray.org...
> Rick Measham <rickm*at%isite.net.au> wrote:
> > Is there any way to do this?
>
>   Not with the current povray.
I'm far from an expert in pic files formats but isn't there a way to extract
image size from the image header?
A SDL macro could be very usefull (at least to automate image ratio)

Marc


Post a reply to this message

From: Warp
Subject: Re: Determining the size of a picture
Date: 6 Oct 2005 05:29:21
Message: <4344ee71@news.povray.org>
Marc Jacquier <jac### [at] wanadoofr> wrote:
> I'm far from an expert in pic files formats but isn't there a way to extract
> image size from the image header?

  Not with the current SDL.

-- 
                                                          - Warp


Post a reply to this message

From: Y Tanabe
Subject: Re: Determining the size of a picture
Date: 6 Oct 2005 06:49:45
Message: <43457FD7.C6D3E94E@kh.rim.or.jp>
Maybe, if you can read .ini file directry.
You can get many parameters from .ini file, I think.

Y.Tanabe
Kobe,Japan


Warp wrote:

>   Not with the current SDL.
>
> --
>                                                           - Warp


Post a reply to this message

From: Marc Jacquier
Subject: Re: Determining the size of a picture
Date: 6 Oct 2005 06:54:31
Message: <43450267$1@news.povray.org>

news:43457FD7.C6D3E94E@kh.rim.or.jp...
> Maybe, if you can read .ini file directry.
> You can get many parameters from .ini file, I think.
>
Yes but in this case it is for an "input" image i.e. for an image_map for
example and not an output image
Marc


Post a reply to this message

From: Y Tanabe
Subject: Re: Determining the size of a picture
Date: 6 Oct 2005 07:20:20
Message: <43458702.41C6EFF9@kh.rim.or.jp>
Dear Marc

I'm sorry I mistook a topic.
May I remeber for treating with input image by SDL as follows.
But this sample is not my original and I can not remember original writer.
Anyway I attach sample file.
Would you please arrange for technoflux.inc.


Marc Jacquier wrote:

> Yes but in this case it is for an "input" image i.e. for an image_map for
> example and not an output image
> Marc


Post a reply to this message


Attachments:
Download 'iso-2022-jp' (8 KB) Download 'iso-2022-jp' (1 KB)

From: Chris B
Subject: Re: Determining the size of a picture
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)

From: ABX
Subject: Re: Determining the size of a picture
Date: 7 Oct 2005 09:32:40
Message: <40uck1916ppsvq5c6us9amgokure3tk2pe@4ax.com>
On Thu, 06 Oct 2005 10:55:00 +1000, Rick Measham <rickm*at%isite.net.au>
wrote:
> 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?

If you do not mind to use patched version then such feature is available in
MegaPOV (as long as I understand you correctly).
See http://megapov.inetart.net/manual-1.2.1/expressions.html#images_sizes

ABX


Post a reply to this message

From: Darren New
Subject: Re: Determining the size of a picture
Date: 7 Oct 2005 12:26:11
Message: <4346a1a3$1@news.povray.org>
ABX wrote:
> If you do not mind to use patched version then such feature is available in
> MegaPOV (as long as I understand you correctly).

I bet you could do it with SDL for images in PPM format.

-- 
   Darren New / San Diego, CA, USA (PST)
    Neither rocks nor slush nor salted rims
    shall keep us from our appointed rounds.


Post a reply to this message

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