Update minimum size of compressed image

This commit is contained in:
linarphy 2023-08-28 10:57:16 +02:00
parent 8d09799726
commit 9c4ec55617
No known key found for this signature in database
GPG key ID: 3D4AAAC3AD16E79C

View file

@ -147,13 +147,13 @@ class Plate:
def compress( self ):
"""
Compress the plate data to fit the biggest dimension in a 1000
pixels axis and the smallest in a 100 pixels axis at minimum.
Compress the plate data to fit the biggest dimension in a 5000
pixels axis and the smallest in a 500 pixels axis at minimum.
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
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
if min_factor < max_factor:
factor = int( mean( ( max_factor , min_factor ) ) )