I have a gray scale image in pdf. Now I need to apple the red color to the image like the effect of tint color in iOS. I implement the color with /Decode, but it paint the whole image with red, even the blank background. So what's the right code tochange the tint color of the image? Thanks.
<</Type/XObject/Subtype/Image/Name/IM0 /Width 128/Height 128/Decode [0.922 0.922 0.122 0.122 0.137 0.137]/SMask 424 0 R/BitsPerComponent 8/ColorSpace/DeviceRGB/Length 2609/Filter/FlateDecode>>
stream
change the tint color of the image? Thanks.I have a gray scale image in pdf. Now I need to apple the red color to the image like the effect of tint color in iOS. I implement the color with /Decode, but it paint the whole image with red, even the blank background. So what's the right code to
<</Type/XObject/Subtype/Image/Name/IM0 /Width 128/Height 128/Decode [0.922 0.922 0.122 0.122 0.137 0.137]/SMask 424 0 R/BitsPerComponent 8/ColorSpace/DeviceRGB/Length 2609/Filter/FlateDecode>>
stream
Sounds like the image covers the entire page to me, from your
description. But since you haven't posted the entire PDF its not
possible to tell for certain. I'd suggest you put the file somewhere (eg DropBox) and post a URL here.
Note that your 'gray scale image' includes a transparent Soft Mask,
which complicates matters somewhat.
Your Decode array seems to force all the RGB components to R=.922, G=
0.122, B=0.137 which doesn't seem like the right thing to do, to me, presumably you want shades of red, not the entire image set to the smae
RGB value.
If you are starting with a gray scale image (so 8 bits per component, 1 component), its probably easiest to use a /Indexed coluor space, and
have each of the possible 256 gray values in the gray scale map to a specific RGB value.
Ken
Sysop: | Keyop |
---|---|
Location: | Huddersfield, West Yorkshire, UK |
Users: | 295 |
Nodes: | 16 (2 / 14) |
Uptime: | 05:15:58 |
Calls: | 6,642 |
Calls today: | 2 |
Files: | 12,190 |
Messages: | 5,325,847 |