Forum breadcrumbs - You are here:ForumGerbil Inkscape Plugins: Using Gerbil PluginsHow to use the grey shading optio …
How to use the grey shading options (pseudo gamma correction)
Paul@paul
651 Posts
#1 · February 21, 2018, 2:06 am
Quote from Paul on February 21, 2018, 2:06 amDave's Gale description of the grey shading option (two parameters) The multiply/offset method I used is a simpler way to create a gamma correction than the exponential decay method (you have to rerun the entire matrix through the exp. method and that takes time). I did not expected a lot of this method but it did perform much better than expected. Grey Offset and Compression / Expansion The Grey Offset value is used to marginally increase or decrease the beginning value that would be the "S" value (PWM) of a G91 gcode. A negative value will decrease the "S" value making the engraving lighter while a positive number will make the engraving darker. Compression / Expansion is basically a percentage of the value derived from the application of the Grey Offset to the original value of "S". A higher Compression / Expansion value will increase the ultimate "S" value making the engraving darker while a lower Compression / Expansion value will decrease the ultimate "S" value making the engraving lighter. The formula is essentially (Compression Expansion multiplied with (Grey offset - original "S" value)) For example: ex1 ex2 ex3 ex4 ex5 ex6 ex7 ex8 ex9 ex10 original "S" value 182 182 182 182 182 182 182 182 182 182 Grey Offset 0 -5 -10 +5 +10 0 0 0 0 -15 Compression/Expansion 1.0 1.0 1.0 1.0 1.0 .9 .8 1.1 1.2 .7 equals new "S" value 73 68 63 78 83 65.69 58.40 80 87.60 40 in the examples above, ex1 has no adjustments. ex2 and ex3 reduce the "S" value making the engraving lighter ex4 and ex5 increase the "S" value making the engraving darker ex6 and ex7 reduce the "S" value making the engraving lighter ex8 and ex9 increase the "S" value making the engraving darker ex10 is a combination which makes the engraving much lighter The effect on the engraving is less with the Grey Offset (shift of zero) than it is with the Compression / Expansion (multiply) so adjustments should be made accordingly. Minor adjustments to lightness or darkness can be done with just the Grey Offset, while more extreme cases of lightness or darkness will most likely need a Compression / Expansion adjustment, possibly in addition the a Grey Offset adjustment. It's a matter of applying intuition to a trial and error process, but it does save you from needing to adjust "$30 laser power range" values for any but extreme cases. A good way to start is to make a small version of the image you want to engrave and tinker with these parameters until you are pleased with the engraved result. Then expand the image for your full size engraving and run it. (Comment Paul: I used a black/white photo to test it and saw more details with certain settings. It also depends on the type of wood you use) A perfect original could leave these parameters at 0 for Grey offset and 1 for Compression / Expansion thereby having no effect on the engraving. (If you find one of those perfect originals, please send it to me.) (Comment Paul: It also depends on the tube's state/age and the used plywood) Comment: a challenge for those with programming skills - implement a true Gamma correction curve - exponential growth for light greys and slowed/decayed growth for dark/black.
Dave's Gale description of the grey shading option (two parameters) The multiply/offset method I used is a simpler way to create a gamma correction than the exponential decay method (you have to rerun the entire matrix through the exp. method and that takes time). I did not expected a lot of this method but it did perform much better than expected. Grey Offset and Compression / Expansion The Grey Offset value is used to marginally increase or decrease the beginning value that would be the "S" value (PWM) of a G91 gcode. A negative value will decrease the "S" value making the engraving lighter while a positive number will make the engraving darker. Compression / Expansion is basically a percentage of the value derived from the application of the Grey Offset to the original value of "S". A higher Compression / Expansion value will increase the ultimate "S" value making the engraving darker while a lower Compression / Expansion value will decrease the ultimate "S" value making the engraving lighter. The formula is essentially (Compression Expansion multiplied with (Grey offset - original "S" value)) For example: ex1 ex2 ex3 ex4 ex5 ex6 ex7 ex8 ex9 ex10 original "S" value 182 182 182 182 182 182 182 182 182 182 Grey Offset 0 -5 -10 +5 +10 0 0 0 0 -15 Compression/Expansion 1.0 1.0 1.0 1.0 1.0 .9 .8 1.1 1.2 .7 equals new "S" value 73 68 63 78 83 65.69 58.40 80 87.60 40 in the examples above, ex1 has no adjustments. ex2 and ex3 reduce the "S" value making the engraving lighter ex4 and ex5 increase the "S" value making the engraving darker ex6 and ex7 reduce the "S" value making the engraving lighter ex8 and ex9 increase the "S" value making the engraving darker ex10 is a combination which makes the engraving much lighter The effect on the engraving is less with the Grey Offset (shift of zero) than it is with the Compression / Expansion (multiply) so adjustments should be made accordingly. Minor adjustments to lightness or darkness can be done with just the Grey Offset, while more extreme cases of lightness or darkness will most likely need a Compression / Expansion adjustment, possibly in addition the a Grey Offset adjustment. It's a matter of applying intuition to a trial and error process, but it does save you from needing to adjust "$30 laser power range" values for any but extreme cases. A good way to start is to make a small version of the image you want to engrave and tinker with these parameters until you are pleased with the engraved result. Then expand the image for your full size engraving and run it. (Comment Paul: I used a black/white photo to test it and saw more details with certain settings. It also depends on the type of wood you use) A perfect original could leave these parameters at 0 for Grey offset and 1 for Compression / Expansion thereby having no effect on the engraving. (If you find one of those perfect originals, please send it to me.) (Comment Paul: It also depends on the tube's state/age and the used plywood) Comment: a challenge for those with programming skills - implement a true Gamma correction curve - exponential growth for light greys and slowed/decayed growth for dark/black.
Click for thumbs down.0Click for thumbs up.0
Cheers,
Paul
awesome.tech