@@ -6486,8 +6486,6 @@ def read_rect(
64866486 coord_space = coord_space ,
64876487 ** kwargs ,
64886488 )
6489- if self .post_proc is not None :
6490- base_region = self .post_proc (base_region )
64916489 base_region = Image .fromarray (
64926490 utils .transforms .background_composite (base_region , alpha = True ),
64936491 )
@@ -6498,7 +6496,12 @@ def read_rect(
64986496 )
64996497 base_region = Image .alpha_composite (base_region , im_region )
65006498 base_region = base_region .convert ("RGB" )
6501- return np .array (base_region )
6499+ base_region = np .array (base_region )
6500+ if self .post_proc is not None :
6501+ base_region = self .post_proc (base_region )
6502+ return base_region
6503+ if self .post_proc is not None :
6504+ im_region = self .post_proc (im_region )
65026505 return utils .transforms .background_composite (im_region , alpha = False )
65036506
65046507 def read_bounds (
@@ -6681,8 +6684,6 @@ class docstrings for more information.
66816684 coord_space = coord_space ,
66826685 ** kwargs ,
66836686 )
6684- if self .post_proc is not None :
6685- base_region = self .post_proc (base_region )
66866687 base_region = Image .fromarray (
66876688 utils .transforms .background_composite (base_region , alpha = True ),
66886689 )
@@ -6693,7 +6694,12 @@ class docstrings for more information.
66936694 )
66946695 base_region = Image .alpha_composite (base_region , im_region )
66956696 base_region = base_region .convert ("RGB" )
6696- return np .array (base_region )
6697+ base_region = np .array (base_region )
6698+ if self .post_proc is not None :
6699+ base_region = self .post_proc (base_region )
6700+ return base_region
6701+ if self .post_proc is not None :
6702+ im_region = self .post_proc (im_region )
66976703 return utils .transforms .background_composite (im_region , alpha = False )
66986704
66996705
0 commit comments