File tree 3 files changed +23
-6
lines changed
3 files changed +23
-6
lines changed Original file line number Diff line number Diff line change @@ -101,7 +101,9 @@ def halostack_cli(args):
101
101
if not args ['no_alignment' ] and len (images ) > 0 :
102
102
view_img = base_img .luminance ()
103
103
if isinstance (args ['view_gamma' ], float ):
104
+ from halostack .image import _scale
104
105
view_img .enhance ({'gamma' : args ['view_gamma' ]})
106
+ view_img .img = _scale (view_img .img , bits = 8 )
105
107
print "\n Click tight area (two opposite corners) for " \
106
108
"reference location.\n "
107
109
args ['focus_reference' ] = get_two_points (view_img )
Original file line number Diff line number Diff line change @@ -235,13 +235,13 @@ Below is an example configuration::
235
235
# average stack from raw/tiff images with view gamma set
236
236
[avg_from_raw]
237
237
avg_stack_file = average.png
238
- view_gamma = 1.5
238
+ view_gamma = 0.45
239
239
240
240
# average stack from linear raw/tiff images with view gamma set
241
241
# and USM applied to the stack
242
242
[avg_from_raw]
243
243
avg_stack_file = average.png
244
- view_gamma = 1.5
244
+ view_gamma = 0.45
245
245
enhance_stacks = usm:25,2
246
246
247
247
# B-R processing without stacking
@@ -496,4 +496,19 @@ is equal to::
496
496
-E stretch:0.02,0.98
497
497
498
498
499
+ Gamma correction
500
+ ++++++++++++++++
501
+
502
+ Apply gamma correction to the image. Can be used in either of pre- or
503
+ post-processing.
504
+
505
+ Syntax::
506
+
507
+ - E gamma:0.5
508
+ - E gamma:2.0
509
+
510
+ Values less than one makes the image lighter and greather value
511
+ darkens the image.
512
+
513
+
499
514
.. _Lefadeux : http://opticsaround.blogspot.fr/2013/03/le-traitement-bleu-moins-rouge-blue.html
Original file line number Diff line number Diff line change @@ -289,7 +289,7 @@ def enhance(self, enhancements):
289
289
* ``float``: light source azimuth in degrees [``90``]
290
290
* ``float``: light source elevation in degrees [``45``]
291
291
292
- * ``gamma``: gamma correction using *ImageMagick*
292
+ * ``gamma``: gamma correction
293
293
294
294
* possible calls:
295
295
@@ -752,10 +752,10 @@ def _gamma(self, args):
752
752
return
753
753
if not isinstance (args , list ):
754
754
args = [args ]
755
- self ._to_imagemagick ()
755
+ self ._to_numpy ()
756
756
LOGGER .debug ("Apply gamma correction, gamma: %.2lf." , args [0 ])
757
- self .img . gamma ( args [ 0 ] )
758
-
757
+ self .img /= self . img . max ( )
758
+ self . img **= args [ 0 ]
759
759
760
760
def _blur_worker (data_in ):
761
761
'''Worker for blurring rows in parallel.
You can’t perform that action at this time.
0 commit comments