Image Transformation
-
Could any body provide me basic algorithms for Fading IN or Fading Out of the Image and other related EFFECT. Thanks
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers, Alok Gupta
-
Could any body provide me basic algorithms for Fading IN or Fading Out of the Image and other related EFFECT. Thanks
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers, Alok Gupta
I haven't done such a fade in filter but for a smooth transition--one image fading to another--I'd guess you just need to scale each pixel's R,G & B values in the 'old' image toward the R,G & B values of the corresponding pixels in the new image. e.g if you want to do a full fade from old image to identically sized new image in 10 steps :
for ( each pixel position in the image(s) ){
__for (Step = 1; Step<=10; Step++){
____IntermediateR = OldR + (NewR-OldR)/10 * Step;
____IntermediateG = OldG + (NewG-OldG)/!0 * Step;
____IntermediateB = OldB + (NewB-OldB)/10 * Step;
__}
}(Be sure to use signed types for the RGB values so that the scaling will correctly handle the cases where R, G or B in the old image are larger than the corresponding R, G or B value in the new image.) If you want to fade to (or from) a 'blank' screen just substitute the constant 'blank' RGB values for the new (or old) image pixel position RGB values as required. Steve T
-
I haven't done such a fade in filter but for a smooth transition--one image fading to another--I'd guess you just need to scale each pixel's R,G & B values in the 'old' image toward the R,G & B values of the corresponding pixels in the new image. e.g if you want to do a full fade from old image to identically sized new image in 10 steps :
for ( each pixel position in the image(s) ){
__for (Step = 1; Step<=10; Step++){
____IntermediateR = OldR + (NewR-OldR)/10 * Step;
____IntermediateG = OldG + (NewG-OldG)/!0 * Step;
____IntermediateB = OldB + (NewB-OldB)/10 * Step;
__}
}(Be sure to use signed types for the RGB values so that the scaling will correctly handle the cases where R, G or B in the old image are larger than the corresponding R, G or B value in the new image.) If you want to fade to (or from) a 'blank' screen just substitute the constant 'blank' RGB values for the new (or old) image pixel position RGB values as required. Steve T
Thanks I will try it :)
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers, Alok Gupta