my digital grain technique - C&C please
Carmelo75
Registered Users Posts: 232 Major grins
hi everybody,
I would like to get some opinions about a digital grain rendering technique on which I am working in my spare time.
I do not want to enter here in the debate whether digital film grain makes sense or not; I think many people used high speed films for artistical reasons more than for necessity, so why not obtain something similar with digital files?
After having tried the simple recipes found on the web, which basically suggest to take either a random noise pattern or a scanned film image and blend it to your image in overlay mode, I was totally unhappy of the result when printing the images on A4 or more, so I decided to go my way and take a different approach.
BE AWARE: this is not a commercial software, and I'm ready to share all the details of what I am doing, if there are people interested. On the other end, the technique is not simple and cannot be translated into, say, a photoshop action, so I prefer to provide a long and detailed description only if there are poeple interested in it...
Here is a test image showing one possible grain rendering. The top part contains a grainy picture at the native resolution of my camera (12M pixels); the bottom contains a detail of the top one, corresponding to the resolution at which the grain is rendered (about 3.5x).
Hope the post is pertinent to this forum, and that you'll find it interesting :scratch.
Carmelo.
I would like to get some opinions about a digital grain rendering technique on which I am working in my spare time.
I do not want to enter here in the debate whether digital film grain makes sense or not; I think many people used high speed films for artistical reasons more than for necessity, so why not obtain something similar with digital files?
After having tried the simple recipes found on the web, which basically suggest to take either a random noise pattern or a scanned film image and blend it to your image in overlay mode, I was totally unhappy of the result when printing the images on A4 or more, so I decided to go my way and take a different approach.
BE AWARE: this is not a commercial software, and I'm ready to share all the details of what I am doing, if there are people interested. On the other end, the technique is not simple and cannot be translated into, say, a photoshop action, so I prefer to provide a long and detailed description only if there are poeple interested in it...
Here is a test image showing one possible grain rendering. The top part contains a grainy picture at the native resolution of my camera (12M pixels); the bottom contains a detail of the top one, corresponding to the resolution at which the grain is rendered (about 3.5x).
Hope the post is pertinent to this forum, and that you'll find it interesting :scratch.
Carmelo.
0
Comments
interesting..seem to be working. I wonder if you have any shots of something less abstract..a face for example.
14-24 24-70 70-200mm (vr2)
85 and 50 1.4
45 PC and sb910 x2
http://www.danielkimphotography.com
I look forward to seeing your specific steps, that we may duplicate this for our viewer's images here.
Moderator of the Technique Forum and Finishing School on Dgrin
The steps that produce the grain effect shown here are, in a simplified form, the following:
1) the original image is magnified 4x and divided into small tiles
2) in each tile, the pixels are replaced by "digital grains"
2a) the location of the new grain is choosen randomly inside the tile
2b) the size of the new grain is tandomly choosen, according to a user-defined distribution
2c) the average grayscale tone of the image in the region covered by the grain is computed, and is randomized to obtain the "grain tone"
2d) the grayscale value of the image pixels in the grain region is replaced by the "grain tone"
3) Steps 2a-2d are repeated until all pixels in the tile have been processed, then the tile is downscaled by 4x to obtain the final grainy image, and the next tile is started
The result is an image made of grayscale "patches" of random shape and size, whose darkness is IN AVERAGE equivalent to that of the original image. Compared to the simple overlay blend method, one gets more pronounced and natural grains in the shadow and highlights portions, and there is more control on the size and strength of the grain structure. Moreover, the grains can be rendered at virtually any resolution, making it possible to upscale the images without pixelization effects.
Here is the original test image:
Here is a comparison of the two methods.
Overaly noise blend:
Digital grain:
This is a 100% magnification detail of the above original image:
Overlay noise blend:
Digital grain:
The images are pretty similar in the mid tones, but the difference in the dark and light regions is evident... I personally find the last image more realistic, but I would like to get your opinions (you are also free to tell me that I should stop loosing my spare time...).
I plan to make some documentation ad the code available at this address:
http://digitalgrain.sourceforge.net/
All kind of comments will be appreciated.
Carmelo.
I can see the differences..I am ambivalent about them mostly. I think your method is more realistic but marginally so. It is very clever though. I am reminded of what some other poster once said about you PS gurus..you guys find the most fiendishly clever and complicated tricks to do something that can be done very simply another way.
14-24 24-70 70-200mm (vr2)
85 and 50 1.4
45 PC and sb910 x2
http://www.danielkimphotography.com
Thanks for looking and commenting Quarik, I appreciated.
First, let me state that I am not a PS guru at all, in fact all I descibed is not done in PS, as I would not know how to do obtain it. But I am a reasonably good programmer, and I wrote my own small image processing program for pure curiosity to see the result...
In fact, before starting all that I have printed a couple of A4 pictures with a grainy look produced with the overlay method, and found the result quite unnatural. The difference is not so evident in web pictures, but it becomes (at least for me) annoying when I come to printing.
The point is that I have not found any simple way of getting a nice grain in shadow areas with PS or other programs (I have for example tried TrueGrain in the demo version, but I have not been impressed too much) .
Therefore I decided to try something different, maybe more complicated but with hopefully more pleasing results.
I usually do not like to complicate my life more than needed, but I like to follow the ideas and see where they bring...
Carmelo.
ahh..I thought you did this in PS. I know that LR3 is adding a "film grain" module to it arsenal. That should be interesting. Lastly you could on some occasion simply shoot at a higher iso and/or underxpose and push exposure in post to create noise if that is an option.
14-24 24-70 70-200mm (vr2)
85 and 50 1.4
45 PC and sb910 x2
http://www.danielkimphotography.com
I will try to understand what the LR3 film grain module is doing, hope it does better than the film grain filter in PS...
Shooting at high iso is in fact not really an option, as digital noise is very different from true grain. In particular, noise is a randomization of the CCD/CMOS readings that is in first approximation independent of the actual pixel luminosity, and only depends on the sensor gain and exposure time. As a consequence, it also appears in deep shadows or highlights, so that at high iso you cannot obtain pure black or pure white...