Problem creating a transparent eps file from a black and whi

Post any defects you find in the released or beta versions of the ImageMagick software here. Include the ImageMagick version, OS, and any command-line required to reproduce the problem. Got a patch for a bug? Post it here.
kanwar_daman

Problem creating a transparent eps file from a black and whi

Post by kanwar_daman »

Hey Folks,

I am stuck for nearly 2 months now.
The problem is i have to create transparent eps files out of black and white JPG files (white part of the image should be converted to transparent in the final eps file).

When i do as suggested in viewtopic.php?f=2&t=13825 , the eps files which gets created are not of transparent background , they default to a white background.
did this too "convert black_and_white_logo.jpg -transparent white eps3:image1.eps

Please i would be very grateful to anyone who can resolve this problem.

Attaching the jpg file which needs to be converted into a black and transparent eps file.

Looking forward to see this resolved as soon as possible.

regards,
Kanwar
User avatar
magick
Site Admin
Posts: 11064
Joined: 2003-05-31T11:32:55-07:00

Re: Problem creating a transparent eps file from a black and whi

Post by magick »

JPEG has a natural variation in image pixels so its unlikely your image has a solid white background. Add the -fuzz option to your command line to make pixels that are close to white transparent.

For testing with ImageMagick 6.5-3-7 we have a transparent PNG image and use these commands:
  • convert logo.png eps3:logo.eps
    convert logo.eps image.png
The resulting image.png has a transparent background as expected.
kanwar_daman

Re: Problem creating a transparent eps file from a black and whi

Post by kanwar_daman »

Thanks for your instant reply.

As per your suggestion, i did the following to be sure the white color is actaully white

1) C:\>convert black_and_white.jpg -density 300x300 -resize 900 -monochrome abc.jpg

2) using the monchrome image "abc.jpg" produced from step1, i did this and used fuzz factor too
C:\>convert abc.jpg -density 300x300 -resize 900 -fuzz 50% -transparent white eps3:logo.eps

But still it is not transparent, i checked the background with a software , the background has pixels (255,255,255), so it is white.

Please help

regards,
Kanwar
User avatar
magick
Site Admin
Posts: 11064
Joined: 2003-05-31T11:32:55-07:00

Re: Problem creating a transparent eps file from a black and whi

Post by magick »

Perhaps your software has a bug. Or perhaps you are using an older version of the Ghostscript program. We're using GS 8.64. Try this command:
  • identify -verbose logo.eps
Does the image have an alpha channel? Our tests shows:
  • alpha:
    min: 0 (0)
    max: 65535 (1)
    mean: 12582.6 (0.191998)
    standard deviation: 25812.4 (0.393871)
    kurtosis: 0.446017
    skewness: -1.56397
kanwar_daman

Re: Problem creating a transparent eps file from a black and whi

Post by kanwar_daman »

Hi,
The Ghostscript version i am using is 8.63

This is what i get when i do identify

C:\>convert abc.jpg -density 300x300 -resize 900 -alpha on -fuzz 50% -transparent white eps3:logo.eps

C:\>identify -verbose logo11.eps


Image: logo11.eps
Format: PS (PostScript)
Class: DirectClass
Geometry: 216x69+0+0
Resolution: 72x72
Print size: 3x0.958333
Units: Undefined
Type: GrayscaleMatte
Base type: GrayscaleMatte
Endianess: Undefined
Colorspace: RGB
Depth: 16/8-bit
Channel depth:
gray: 8-bit
alpha: 1-bit
Channel statistics:
gray:
min: 0 (0)
max: 65535 (1)
mean: 37949.2 (0.579068)
standard deviation: 32275.5 (0.492493)
kurtosis: -1.8974
skewness: -0.319917
alpha:
min: 65535 (1)
max: 65535 (1)
mean: 65535 (1)
standard deviation: 0 (0)
kurtosis: 0
skewness: 0
Histogram:
7772: (65535,65535,65535,65535) #FFFFFFFFFFFF white
5278: ( 0, 0, 0,65535) #000000000000 black
338: ( 257, 257, 257,65535) #010101010101 rgba(1,1,1,1)
329: (65278,65278,65278,65535) #FEFEFEFEFEFE rgba(254,254,254,1)
252: ( 514, 514, 514,65535) #020202020202 rgba(2,2,2,1)
201: ( 771, 771, 771,65535) #030303030303 grey1
175: (65021,65021,65021,65535) #FDFDFDFDFDFD rgba(253,253,253,1)
157: (64764,64764,64764,65535) #FCFCFCFCFCFC grey99
104: ( 1028, 1028, 1028,65535) #040404040404 rgba(4,4,4,1)
85: (64507,64507,64507,65535) #FBFBFBFBFBFB rgba(251,251,251,1)
60: (64250,64250,64250,65535) #FAFAFAFAFAFA grey98
52: ( 1285, 1285, 1285,65535) #050505050505 grey2
24: (63993,63993,63993,65535) #F9F9F9F9F9F9 rgba(249,249,249,1)
23: (63736,63736,63736,65535) #F8F8F8F8F8F8 rgba(248,248,248,1)
21: ( 1542, 1542, 1542,65535) #060606060606 rgba(6,6,6,1)
12: ( 1799, 1799, 1799,65535) #070707070707 rgba(7,7,7,1)
9: ( 2056, 2056, 2056,65535) #080808080808 grey3
2: ( 2313, 2313, 2313,65535) #090909090909 rgba(9,9,9,1)
2: ( 2827, 2827, 2827,65535) #0B0B0B0B0B0B rgba(11,11,11,1)
2: ( 3598, 3598, 3598,65535) #0E0E0E0E0E0E rgba(14,14,14,1)
2: (63222,63222,63222,65535) #F6F6F6F6F6F6 rgba(246,246,246,1)
2: (63479,63479,63479,65535) #F7F7F7F7F7F7 grey97
1: ( 2570, 2570, 2570,65535) #0A0A0A0A0A0A grey4
1: ( 3084, 3084, 3084,65535) #0C0C0C0C0C0C rgba(12,12,12,1)
Rendering intent: Undefined
Interlace: None
Background color: white
Border color: rgba(223,223,223,1)
Matte color: grey74
Transparent color: none
Page geometry: 216x69+0+0
Dispose: Undefined
Iterations: 0
Compression: Undefined
Orientation: Undefined
Properties:
create-date: 2009-06-15T21:50:01+00:00
modify-date: 2009-06-15T21:50:02+00:00
ps:HiResBoundingBox: 216x69+0+0
ps:Level: Adobe-3.0 EPSF-3.0

signature: 19ad8870502ce2e0c4748984f922dd42f34a92e203644a6d314d8bcc375fc257
Artifacts:
verbose: true
Tainted: False
Filesize: 4.92kb
Number pixels: 14.6kb
Version: ImageMagick 6.5.0-1 2009-03-14 Q16
User avatar
magick
Site Admin
Posts: 11064
Joined: 2003-05-31T11:32:55-07:00

Re: Problem creating a transparent eps file from a black and whi

Post by magick »

Your image is completely opaque. Save your image to PNG and use the identify command. Does the alpha channel show levels of transparency? If so your command is correct. Next you could try upgrading Ghostscript and ImageMagick to fix the problem.
kanwar_daman

Re: Problem creating a transparent eps file from a black and whi

Post by kanwar_daman »

Hey,
As per your direction, i updatecd my Ghostscript to 8.64 and ran the same commands, this time created png instead og eps,
and it came out transparent background, but the eps is still not transparent background.

Please help
kanwar_daman

Re: Problem creating a transparent eps file from a black and whi

Post by kanwar_daman »

Please help????
User avatar
magick
Site Admin
Posts: 11064
Joined: 2003-05-31T11:32:55-07:00

Re: Problem creating a transparent eps file from a black and whi

Post by magick »

We have run out of ideas. Unless we can reproduce a problem, its difficult to debug. We cannot reproduce this problem.
kanwar_daman

Re: Problem creating a transparent eps file from a black and whi

Post by kanwar_daman »

Can i somehow send you couple of jpg's , and you can try getting the background transparent
Please
User avatar
magick
Site Admin
Posts: 11064
Joined: 2003-05-31T11:32:55-07:00

Re: Problem creating a transparent eps file from a black and whi

Post by magick »

Post a URL to your JPEG images and the exact command you are using. We'll see if we can reproduce your problem.
kanwar_daman

Re: Problem creating a transparent eps file from a black and whi

Post by kanwar_daman »

The url is http://208.77.236.124:8080/idp/images2/

example : http://208.77.236.124:8080/idp/images2/ ... i_logo.jpg

and the file names are
1) CPK_AI_CS2_ai_logo.jpg
2) CPK_AI_CS2_eps_logo.jpg
3) dominoes2_pdf_logo.jpg
4) Famous_Daves_ai_logo.jpg
5) Famous_daves_resaved_daniel_eps_logo.jpg
6) Marleyfoil_ai_logo.jpg
7) Marleyfoil_eps_logo.jpg
8) grooves_eps_logo.jpg

the commands i am using is

METHOD 1
1) convert CPK_AI_CS2_ai_logo.jpg -density 300x300 -resize 900 -alpha on -fuzz 50% -transparent white eps3:logo.eps

METHOD 2
i tried tone more thing, to convert the image into monochrome and then apply the transparency logic
1) convert CPK_AI_CS2_ai_logo.jpg -density 300x300 -resize 900 -monochrome abc.jpg
2) convert abc.jpg -density 300x300 -resize 900 -alpha on -fuzz 50% -transparent white eps3:logo.eps

but unfortunately i am unable to get a transparent background eps file.

Your help will be highly appreciated.
User avatar
magick
Site Admin
Posts: 11064
Joined: 2003-05-31T11:32:55-07:00

Re: Problem creating a transparent eps file from a black and whi

Post by magick »

Try this command:
  • convert CPK_AI_CS2_ai_logo.jpg -fuzz 15% -transparent white -compress zip eps3:CPK_AI_CS2_ai_logo.eps
kanwar_daman

Re: Problem creating a transparent eps file from a black and whi

Post by kanwar_daman »

buddy this is the outcome of the command you gave me

http://208.77.236.124:8080/idp/images2/ ... i_logo.eps
kanwar_daman

Re: Problem creating a transparent eps file from a black and whi

Post by kanwar_daman »

if you are not able to access it, try this one, rename the file to eps
http://208.77.236.124:8080/idp/images2/ ... TO_EPS.jpg
Post Reply