Update minimum size of compressed image
This commit is contained in:
parent
8d09799726
commit
9c4ec55617
1 changed files with 4 additions and 4 deletions
|
@ -147,13 +147,13 @@ class Plate:
|
||||||
|
|
||||||
def compress( self ):
|
def compress( self ):
|
||||||
"""
|
"""
|
||||||
Compress the plate data to fit the biggest dimension in a 1000
|
Compress the plate data to fit the biggest dimension in a 5000
|
||||||
pixels axis and the smallest in a 100 pixels axis at minimum.
|
pixels axis and the smallest in a 500 pixels axis at minimum.
|
||||||
Return the compressed data and the compression factor used.
|
Return the compressed data and the compression factor used.
|
||||||
"""
|
"""
|
||||||
min_factor = max( self.data.shape ) // 1000 # min factor to have a side
|
min_factor = max( self.data.shape ) // 5000 # min factor to have a side
|
||||||
# with a maximum of 1000 pixels
|
# with a maximum of 1000 pixels
|
||||||
max_factor = min( self.data.shape ) // 100 # max factor to have
|
max_factor = min( self.data.shape ) // 500 # max factor to have
|
||||||
# a side with a minimum of 100 pixel
|
# a side with a minimum of 100 pixel
|
||||||
if min_factor < max_factor:
|
if min_factor < max_factor:
|
||||||
factor = int( mean( ( max_factor , min_factor ) ) )
|
factor = int( mean( ( max_factor , min_factor ) ) )
|
||||||
|
|
Loading…
Reference in a new issue