POV-Ray : Newsgroups : povray.general : access to individual pixels/dots? Server Time
9 Aug 2024 13:23:09 EDT (-0400)
  access to individual pixels/dots? (Message 1 to 5 of 5)  
From: vaihtoehto
Subject: access to individual pixels/dots?
Date: 31 Jul 2000 08:41:27
Message: <398573f7@news.povray.org>
hi,

i was just wondering if there is (or there will be) a way to access
individual
pixels of image via povscript?
i mean reading an x,y pixel from image and writing an x,y pixel to image?
this would allow a way to generate faked 2d effects over 3d rendering, such
as
plasma, smoke or whatever..

by the way, is there any way to generate pigments dot by dot?
like:
[0, 0 color rgb <1,1,1>] /*upper left corner of the dotmap*/
[1, 0 color rgb <1,1,1>]
...
[256, 256 color rgb <0,0,0>] /*down right corner*/
or in array style with rgb triplets:
[<1,1,1>,<1,1,1>,<0,0,0>,...,<0.5,0.5,0.5>]
or something..

this would allow people to map those 2d effects on the objects and with
binary fread it would allow reading in any 2d imageformat for mapping.
binary fread would also allow to read in any 3d format..

thanks,
alt


Post a reply to this message

From: Fabien Mosen
Subject: Re: access to individual pixels/dots?
Date: 31 Jul 2000 08:50:45
Message: <398574C2.887C136@skynet.be>
vaihtoehto wrote:
> 
> hi,
> 
> i was just wondering if there is (or there will be) a way to access
> individual
> pixels of image via povscript?
> i mean reading an x,y pixel from image and writing an x,y pixel to image?

Reading is possible trough Megapov's eval_pigment function,
but no writing.  This could be an intersesting way to store data,
though..

Fabien.


Post a reply to this message

From: Warp
Subject: Re: access to individual pixels/dots?
Date: 31 Jul 2000 09:07:58
Message: <39857a2e@news.povray.org>
vaihtoehto <lau### [at] kolumbusfi> wrote:
: i was just wondering if there is (or there will be) a way to access
: individual
: pixels of image via povscript?

  Megapov's post-processing has something like this.

-- 
main(i,_){for(_?--i,main(i+2,"FhhQHFIJD|FQTITFN]zRFHhhTBFHhhTBFysdB"[i]
):_;i&&_>1;printf("%s",_-70?_&1?"[]":" ":(_=0,"\n")),_/=2);} /*- Warp -*/


Post a reply to this message

From: Chris Huff
Subject: Re: access to individual pixels/dots?
Date: 31 Jul 2000 21:46:06
Message: <chrishuff-6EB3BD.20465731072000@news.povray.org>
In article <39857a2e@news.povray.org>, Warp <war### [at] tagpovrayorg> 
wrote:

>   Megapov's post-processing has something like this.

It does?

Anyway, the only way I can think of to read a pixel is with 
eval_pigment() and an image_map, as was already mentioned. For writing, 
you are out of luck...the best you could do is use post_processing add, 
multiply, etc. to layer a pigment on the image.
(was that what you were talking about, Warp?)

-- 
Christopher James Huff - Personal e-mail: chr### [at] maccom
TAG(Technical Assistance Group) e-mail: chr### [at] tagpovrayorg
Personal Web page: http://homepage.mac.com/chrishuff/
TAG Web page: http://tag.povray.org/


Post a reply to this message

From: Gibus
Subject: Re: access to individual pixels/dots?
Date: 1 Aug 2000 21:36:14
Message: <39877b0e@news.povray.org>
i was wondering too on this question this week!!!
i found a solution,you can read an image with the eval pigment and save each
pixel in a file.
to write an image dot by dot,you create a scne with an orthographic camera.
you create for exemple 640*480 boxes for a 640*480 sized image.
with a double while system,you read the pixel file,change the color pixel
per pixel and assign it to the corresponding box in the scene
when you render the scene,you obtain what you want!!!


i was thinking about a negative filter: you read the pixel color: <r,g,b>
you apply
#declare pixel[x][y][1]=<1-r,1-g,1-b>


/*double while system with x and y*/
box{<x,y,0><x+1,y+1>
pigment {color rgb pixel[x][y][1]}
finish {diffuse 0 ambient 1 phong 0 specular 0}
}

i will try to write a read macro and a render_image macro where you can
choose the size of the image.

if you don't want to define all pixel of your image,you set <color rgbt
<r,g,b,1> for the pixel you don't want to define and you apply the image you
obtain with his transparancy layer on the image of your original scene with
photoshop for exemple...


gibus


Post a reply to this message

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