POV-Ray : Newsgroups : povray.general : cropping or cutting output Server Time
31 Jul 2024 18:29:21 EDT (-0400)
  cropping or cutting output (Message 1 to 10 of 10)  
From: Olaf Doschke
Subject: cropping or cutting output
Date: 11 Nov 2006 08:25:49
Message: <4555cf5d@news.povray.org>
If I have a camera setup, that I like
but want to crop the image size,
I can use the Start/End_Column/Row
options, but nevertheless Povray
outputs the image with the original
size.

This is okay, as documented in the
help, not a bug.

But can one save the cropped image
too? If making an animation I'd not
like to have postprocessing of the
images.

I don't want to fiddle around with
the camera position and the right
and up vectors. These vectors are
fine for zooming or cropping equally
at both sides left/right or top/bottom
of the picture, but I'd like to be able
to output an individual rectangle of
the picture.

Bye, Olaf.


Post a reply to this message

From: Randall Sawyer
Subject: Re: cropping or cutting output
Date: 26 Nov 2006 21:40:01
Message: <web.456a4d6dae3286878c37caaf0@news.povray.org>
"Olaf Doschke" <b2x### [at] t-onlinede>
wrote:
> If I have a camera setup, that I like
> but want to crop the image size,

I can think of three possible solutions.  Here they are, ranked from least
effort to most:

1) Set your camera type to "orthographic".  See sections 3.3.1.2.2 - for a
description - and 2.3.1.1.1 - for an application - in the POV 3.6 manual.
This method works best if your objects' unit metric is equivalent to one
pixel in your rendered image.

2) Narrow your camera's angle to a very small angle (2 degrees).  If you use
this method, then you might need to spend a little more time at setting up
your
camera's location.  Either this method or the previous one may also require
that
you move your light source(s) to get the results you want.

3) Use a graphics editor like "The Gimp" to crop your images.  You can set
up a Gimp *.xcf image file with the same dimensions as your raw images and
with guides where you wish to crop every one of those images.  If you have
many images to crop identically, then this manual method may get tedious.
In this case, The Gimp includes a custom scripting language (Perl-based, I
believe.  But, I'm not sure.)  If you want to take the time to learn it,
then you could automate your cropping process.  Also, if you're willing to
write a bit of code, then there are other libraries, such as Trolltech's QT
c++ library, that provide the means to manipulate images from file and then
writing new files to disk.

I hope this helps.

-Randall


Post a reply to this message

From: Olaf Doschke
Subject: Re: cropping or cutting output
Date: 27 Nov 2006 08:01:24
Message: <456ae1a4$1@news.povray.org>
> 1) Set your camera type to "orthographic".

> 2) Narrow your camera's angle to a very small angle (2 degrees).

> 3) Use a graphics editor like "The Gimp" to crop your images.

Hi Randall,

Thanks for those solutions, I'll take a look.

I think I'll finally go with 3), using Gimp or
Imagemagick, as I fear I also have other
tasks on the images anyway.

I wanted to create icons for applications, so
I used background {rgbt <0,0,0,1>}, but as
I now wanted a reflection of the object on
a shiny floor, that alone won't help. I need to
cut out the icon and it's reflection, as the shiny
floor should later be the applications form
background, no matter what color that is,
don't want to render for each application form
color.

I'm now creating an image without the floor
to get the icon itself with the correct alphachannel,
then one image with the a shiny white floor, of
which I then need only the reflection part and
use the brightness as alphachannel (as I
want a transition to the applications form color,
I can use the brightness as alpha channel).

A bit complicated, but I had no better idea.

Maybe a floor with color rgbt <0,0,0,1>?
Wonder if that would have a reflection, if
I don't set the interior, but would nevertheless
itself be transparent??!

You can define some nasty surrealistic
materials with pov, that may come in handy.

Bye, Olaf.


Post a reply to this message

From: Chris B
Subject: Re: cropping or cutting output
Date: 27 Nov 2006 08:53:03
Message: <456aedbf$1@news.povray.org>
"Olaf Doschke" <b2x### [at] strconv14de> wrote in 
message news:456ae1a4$1@news.povray.org...
>
> I wanted to create icons for applications, so
> I used background {rgbt <0,0,0,1>}, but as
> I now wanted a reflection of the object on
> a shiny floor, that alone won't help. I need to
> cut out the icon and it's reflection, as the shiny
> floor should later be the applications form
> background, no matter what color that is,
> don't want to render for each application form
> color.
>
> I'm now creating an image without the floor
> to get the icon itself with the correct alphachannel,
> then one image with the a shiny white floor, of
> which I then need only the reflection part and
> use the brightness as alphachannel (as I
> want a transition to the applications form color,
> I can use the brightness as alpha channel).
>
> A bit complicated, but I had no better idea.
>
> Maybe a floor with color rgbt <0,0,0,1>?
> Wonder if that would have a reflection, if
> I don't set the interior, but would nevertheless
> itself be transparent??!
>
> Bye, Olaf.

Hi Olaf,

There are a couple of approaches you may like to try to see if they give you 
the sort of effect you're after.

You can set transparency and reflection to whatever you want (doesn't have 
to follow real-world logic) so, along with command line switches of +UA +FN 
you can use a plane that is both transparent and reflective.

plane {y,-1
  texture {
    pigment {color rgbt 1}
    finish {reflection 1}
  }
}

Alternatively, you could create a roughened fully transparent, fully 
reflective texture, so that it adopts the background color in some parts, 
then use that colour as the transparency colour in a gif, allowing the 
background colour to appear in places. The following example gives more 
transparency on the outer part of the reflection of the object because the 
granite normal causes more of the reflected rays to miss the object:


camera {location <0,1,-5> look_at <0,-1,0>}
light_source { <1, 2, -20> color rgb 1}

sphere {0,1 pigment {color rgb <1,1,1>}}
plane {y,-1
  texture {
    pigment {color rgbt 1}
    normal {granite 0.1  scale 0.01}
    finish {reflection 1}
  }
}

Regards,
Chris B.


Post a reply to this message

From: Olaf Doschke
Subject: Re: cropping or cutting output
Date: 27 Nov 2006 19:30:09
Message: <456b8311@news.povray.org>
Hi Chris,

I should've tried this earlier, nice.

Bye, Olaf.


Post a reply to this message

From: Olaf Doschke
Subject: Re: cropping or cutting output
Date: 27 Nov 2006 20:13:48
Message: <456b8d4c$1@news.povray.org>
> The following example gives more 
> transparency on the outer part of the reflection of the object because the 
> granite normal causes more of the reflected rays to miss the object:

I wish I could have the reflection fading
effect without the smearing effect of that
normal distortion. Would be better, if the
ray would be reflected more or less but
without a distortion.

I experimented with variable reflection,
which gave me no effect and then with
"fresnel on", but that needs an interior,
which funnily makes the ground opaque
again (black when ambient and diffuse=0),
even though color is rgbt 1.

And fresnel is very sensitively reacting to
ior changes and creates a rather abrupt
change from max to min reflection.

So after all I'm rather happy with your
solution. Thanks a lot!

Bye, Olaf.


Post a reply to this message

From: Chris B
Subject: Re: cropping or cutting output
Date: 27 Nov 2006 20:26:47
Message: <456b9057@news.povray.org>
"Olaf Doschke" <b2x### [at] t-onlinede> 
wrote in message news:456b8d4c$1@news.povray.org...
>> The following example gives more transparency on the outer part of the 
>> reflection of the object because the granite normal causes more of the 
>> reflected rays to miss the object:
>
> I wish I could have the reflection fading
> effect without the smearing effect of that
> normal distortion. Would be better, if the
> ray would be reflected more or less but
> without a distortion.
>
> Bye, Olaf.

There is another alternative that springs to mind, and that's to do away 
with the reflective surface all together. If you just use a copy of your 
object, scaled by <1,-1,1> and place it directly beneath your initial 
object, then you can add whatever amount of transparency you want to the 
'reflected' copy of the object.

Hopefully rendering the following example (with command line options +UA 
+FN) should help explain what I mean.

camera {location <0,1,-5> look_at <0,-1,0>}
light_source { <1, 2, -20> color rgb 1}

#declare IconObject = sphere {0,1 pigment {color rgb <1,1,0>} translate y}

object {IconObject pigment {color rgb <1,1,0>}}
object {IconObject scale <1,-1,1> pigment {color rgbt <1,1,0,0.3>}}

Regards,
Chris B.


Post a reply to this message

From: Olaf Doschke
Subject: Re: cropping or cutting output
Date: 28 Nov 2006 17:31:11
Message: <456cb8af$1@news.povray.org>
> object {IconObject scale <1,-1,1> pigment {color rgbt <1,1,0,0.3>}}

And of course I could use a gradient for the pigment, true.

I'll see. I think all those different solutions have their pros and cons.

In this case, as a complexer object could have many pigments
itself, I wonder how to have a modifying pigment just influencing
the transmission part of rgbt.

color*<1,1,1,factor> ?

Bye, Olaf.


Post a reply to this message

From: Chris B
Subject: Re: cropping or cutting output
Date: 28 Nov 2006 17:48:33
Message: <456cbcc1$1@news.povray.org>
"Olaf Doschke" <b2x### [at] t-onlinede> 
wrote in message news:456cb8af$1@news.povray.org...
>> object {IconObject scale <1,-1,1> pigment {color rgbt <1,1,0,0.3>}}
>
> And of course I could use a gradient for the pigment, true.
>
> I'll see. I think all those different solutions have their pros and cons.
>
> In this case, as a complexer object could have many pigments
> itself, I wonder how to have a modifying pigment just influencing
> the transmission part of rgbt.
>
> color*<1,1,1,factor> ?
>
> Bye, Olaf.

One way would be to define the object along with its many pigments inside a 
macro.
You could then use a variable for the transmission component of the colour.
Run the macro once with transmission = 0.
For the 'reflection' run the macro a second time with transmission = 0.5 and 
scale by <1,-1,1>.

Regarsd,
Chris B.


Post a reply to this message

From: Olaf Doschke
Subject: Re: cropping or cutting output
Date: 29 Nov 2006 12:15:16
Message: <456dc024$1@news.povray.org>
> You could then use a variable for the transmission component of the 
> colour.
> Run the macro once with transmission = 0.
> For the 'reflection' run the macro a second time with transmission = 0.5 
> and scale by <1,-1,1>.

I'm partially using objects downloaded from the web.
Of course I can change all the pigment statements, but
then again, I might choose the one or other option you
showed me and use postprocessing of the images too.

I also tried merge of mirrored object + transparent block,
results in a transparent block, of course.

Nevertheless, we should start another tread of that
topic by now. You could write a faq on reflections
;-).

Thanks for all those tipps.

Bye, Olaf.


Post a reply to this message

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