[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: FF Problem (More on the Alpha Channel)



Thomas Bernt wrote:
> 
> Hi Bill,
> 
> thanks again.
> 
> To all:
> 
> I thought it may be interesting on what I'm dabbling
> and maybe I can get some hints how to make it better :-)
> 
> I've made a "depth map" in my 3D software,
> that is simply a gray scale image, like an alpha channel,
> but the brightness of a pixel is related to his distance from the point
> of view.
> (e.g. a pixel value of 200 is 100m from the camera position,
> a pixel value of 100 is 30m .. and so on).

Do you mean the pixel value of 100 is 50m or is it not linear?
> 
> So I get an Image with RGB and A where A is the depth map.
> The Idea is to make a lot of stunning filters :-) related to the
> distance of the pixel to the camera.

That reminds me of the "magic eye" software that takes a grayscale image
and creates a randon dot stereogram (those images where the 3D comes
when you unfocus your eyes). 

> 
> Here's my first one, a "poor man's DOF" (Depth of Field) Filter for
> FIFO:
> --------------------------------------------------------------------
> if(msk>ctl(0))
> {
> R=cnv_r(1,1,1, 1,1,1, 1,1,1,  9);
> G=cnv_g(1,1,1, 1,1,1, 1,1,1,  9);
> B=cnv_b(1,1,1, 1,1,1, 1,1,1,  9);
> }
> --------------------------------------------------------------------


> In Photopaint you first have to copy the BG in an object (layer)
> then make a mask out of the alpha and lay it over the object,
> then apply the filter.
> (thanks again Bill, Kipp)
> 
> This works pretty with FIFO but I had no luck doing this in FF.
> 
> Anything like:
> 
> RGB:a>ctl(0)?cnv(...):r
> 
> don't works, any Ideas where the bug is?
> 
It does work, but you have to setup the image right. Try this:
open an image, double click on the layers pallete (in photoshop)
to make the background layer become a layer with transparency.
Now create a new channel in the channels pallete and apply a gradient
from top to bottom, from black to white. Go to the select menu and load
this selection (alpha 1). Now the bottom half of the image is selected,
press delete to make this half transparent. 
What you have is a image that now has the top with a=255 and in the
bottom has a=0, with a linear gradient between. 
When you apply your filter using FF,

RGB:a>ctl(0)?cnv(...):c (note I use c instead of r, same thing and you
can use it in all of the channels)

you will have the blur only of the part of the image that has a>ctl(0).
If you don't have an image with transparency (a layer), you don't see A:
and you can't edit it. I don't know if Photopaint will support it like
this. Can you make an object partially transparent? Maybe this will pass
the a info to FF.

Hope this helps,

Alf

> regards Thomas