[reportlab-users] Image - mask parameter - effect on screen vs	printer ?
    Richard Shea 
    rshea at thecubagroup.com
       
    Thu Feb 28 04:00:21 EST 2013
    
    
  
Hi - I have an image (details of which are shown below) which I'd like
to use in a Table so that the tables background colour is visible.
To do this I've identified the colour which is current background of the
image (229, 229, 229) and set the mask parameter on the corresponding
Image object to ['229', '229', '229', '229', '229', '229'] so that that
colour should become transparent.
I then set the relevant row in the table to have a BACKGROUND of
Color(float(229)/256, float(229)/256, float(229)/256).
(Yes I know what I'm doing appears to be nonsensical but bear with me !)
The result of this on the screen is very good indeed - the colour is
uniform across the width of the table cell including that part of the
cell which is covered by the image.
Here's the problem. When I print the PDF on some printers the area
behind the Image is a different colour than the rest of the cell. When I
print it on other printers as far as I can see the colour is seamless -
aaargh !
My question is : if you're seeing something different when you print
than when you view is there something obvious I should check/change or
is a situation that's previously unknown !
============================================================================
FOR THE CURIOUS:
In case anyone cares the reason I'm setting a background colour in an
image to be transparent and then setting 
the underlying table cell colour to the 'same' colour is because when I
left the image alone and just put it into the
cell the other cells around it (with nominally the same colour as
background) had a different look - hence my rather
strange experiment with transperency. I hoped that doing what I'm doing
now might help the situation.
============================================================================
DETAILS OF IMAGE FILE IN USE:
Regarding the image mentioned above file the details as shown by
ImageMagick are as follows:
C:\bin\installed\ImageMagick\ImageMagick-6.7.9-6>identify.exe -verbose
"Z:\0000-20120529\WORK1-1600-981-5f370c2b-bf20-4748-85d7-4daa0920edce.PNG"
Image:
Z:\0000-20120529\WORK1-1600-981-5f370c2b-bf20-4748-85d7-4daa0920edce.PNG
  Format: PNG (Portable Network Graphics)
  Class: DirectClass
  Geometry: 1600x981+0+0
  Units: Undefined
  Type: PaletteAlpha
  Endianess: Undefined
  Colorspace: sRGB
  Depth: 8-bit
  Channel depth:
    red: 8-bit
    green: 8-bit
    blue: 8-bit
    alpha: 1-bit
  Channel statistics:
    Red:
      min: 0 (0)
      max: 229 (0.898039)
      mean: 222.882 (0.874048)
      standard deviation: 33.2371 (0.130342)
      kurtosis: 35.7207
      skewness: -5.98468
    Green:
      min: 0 (0)
      max: 229 (0.898039)
      mean: 223.265 (0.875549)
      standard deviation: 32.632 (0.127969)
      kurtosis: 38.7714
      skewness: -6.26897
    Blue:
      min: 0 (0)
      max: 229 (0.898039)
      mean: 223.552 (0.876675)
      standard deviation: 32.3235 (0.126759)
      kurtosis: 40.5713
      skewness: -6.44554
    Alpha:
      min: 255 (1)
      max: 255 (1)
      mean: 255 (1)
      standard deviation: 0 (0)
      kurtosis: 0
      skewness: 0
  Image statistics:
    Overall:
      min: 0 (0)
      max: 229 (0.898039)
      mean: 167.425 (0.656568)
      standard deviation: 28.3476 (0.111167)
      kurtosis: 334.13
      skewness: -47.0674
  Colors: 17
  Histogram:
     26965: (  0,  0,  0,255) #000000 black
      4603: ( 33, 33, 33,255) #212121 grey13
       824: ( 54, 54, 54,255) #363636 grey21
       513: ( 73, 73, 73,255) #494949 srgba(73,73,73,1)
       467: ( 89, 89, 89,255) #595959 grey35
       183: (104,104,104,255) #686868 srgba(104,104,104,1)
       410: (119,119,119,255) #777777 srgba(119,119,119,1)
       255: (133,133,133,255) #858585 grey52
       430: (146,146,146,255) #929292 srgba(146,146,146,1)
        53: (159,159,159,255) #9F9F9F srgba(159,159,159,1)
     30035: (161,181,196,255) #A1B5C4 srgba(161,181,196,1)
       339: (172,172,172,255) #ACACAC srgba(172,172,172,1)
       490: (183,183,183,255) #B7B7B7 srgba(183,183,183,1)
       210: (195,195,195,255) #C3C3C3 srgba(195,195,195,1)
       512: (207,207,207,255) #CFCFCF grey81
        88: (218,218,218,255) #DADADA srgba(218,218,218,1)
   1503223: (229,229,229,255) #E5E5E5 grey90
  Rendering intent: Perceptual
  Gamma: 0.45455
  Chromaticity:
    red primary: (0.64,0.33)
    green primary: (0.3,0.6)
    blue primary: (0.15,0.06)
    white point: (0.3127,0.329)
  Interlace: None
  Background color: white
  Border color: srgba(223,223,223,1)
  Matte color: grey74
  Transparent color: none
  Compose: Over
  Page geometry: 1600x981+0+0
  Dispose: Undefined
  Iterations: 0
  Compression: Zip
  Orientation: Undefined
  Properties:
    date:create: 2013-02-28T11:38:28+13:00
    date:modify: 2013-02-27T05:00:12+13:00
    png:cHRM                 : chunk was found (see Chromaticity, above)
    png:gAMA                 : gamma=0.45454544 (See Gamma, above)
    png:IHDR.bit_depth       : 8
    png:IHDR.color_type      : 6 (RGBA)
    png:IHDR.interlace_method: 0 (Not interlaced)
    png:IHDR.width,height    : 1600, 981
    png:sRGB                 : intent=0 (Perceptual Intent)
    signature:
    3640d77a9be3df74feaf44d1485fc295fada1312d54fece3ca6230965775beaa
  Artifacts:
    filename:
    Z:\0000-20120529\WORK1-1600-981-5f370c2b-bf20-4748-85d7-4daa0920edce.PNG
    verbose: true
  Tainted: False
  Filesize: 70.7KB
  Number pixels: 1.57M
  Pixels per second: 14.81MB
  User time: 0.031u
  Elapsed time: 0:01.106
  Version: ImageMagick 6.7.9-6 2012-09-13 Q16 http://www.imagemagick.org
C:\bin\installed\ImageMagick\ImageMagick-6.7.9-6>
    
    
More information about the reportlab-users
mailing list