Preserve background color ?

Discussions on NConvert - the command line tool for image conversion and manipulation

Moderators: helmut, XnTriq, xnview

Bingo
Posts: 25
Joined: Fri Sep 10, 2004 7:00 am

Preserve background color ?

Post by Bingo »

Hi all !

I'd like to use nconvert to convert EPS files (with a transparent background by design) to PNGs (256 colors, indexed).
If I try :
nconvert -o my.png -out png -dpi 140 my.eps
it works fine : I get a nice png with a white background.
But if I try :
nconvert -o my.png -out png -dpi 140 -colors 256 my.eps
the resulting file has a bluish background color (248,252,249).

The original file is almost only tranparent with some lines and texts (it's a map, actually), and I really need to preserve a white background.
Is there a way to achieve this ?

Thanks for helping !
User avatar
xnview
Author of XnView
Posts: 46236
Joined: Mon Oct 13, 2003 7:31 am
Location: France
Contact:

Re: Preserve background color ?

Post by xnview »

Bingo wrote:Hi all !

I'd like to use nconvert to convert EPS files (with a transparent background by design) to PNGs (256 colors, indexed).
If I try :
nconvert -o my.png -out png -dpi 140 my.eps
it works fine : I get a nice png with a white background.
But if I try :
nconvert -o my.png -out png -dpi 140 -colors 256 my.eps
the resulting file has a bluish background color (248,252,249).

The original file is almost only tranparent with some lines and texts (it's a map, actually), and I really need to preserve a white background.
Is there a way to achieve this ?
No sorry, it's ghostscript
Pierre.
Bingo
Posts: 25
Joined: Fri Sep 10, 2004 7:00 am

Post by Bingo »

Okay.
Now if I convert to PNG (16m colors), and then reprocess the image to reduce colors to 256, can I keep my white... white ?
User avatar
xnview
Author of XnView
Posts: 46236
Joined: Mon Oct 13, 2003 7:31 am
Location: France
Contact:

Post by xnview »

Bingo wrote:Okay.
Now if I convert to PNG (16m colors), and then reprocess the image to reduce colors to 256, can I keep my white... white ?
Try, if you have a lot of white, white will be white
Pierre.
Bingo
Posts: 25
Joined: Fri Sep 10, 2004 7:00 am

Post by Bingo »

xnview wrote:
Bingo wrote:Okay.
Now if I convert to PNG (16m colors), and then reprocess the image to reduce colors to 256, can I keep my white... white ?
Try, if you have a lot of white, white will be white
I tried, but white is not white.
I really have a lot of white though ! I'd say around 95% maybe.
User avatar
xnview
Author of XnView
Posts: 46236
Joined: Mon Oct 13, 2003 7:31 am
Location: France
Contact:

Post by xnview »

Bingo wrote:
xnview wrote:
Bingo wrote:Okay.
Now if I convert to PNG (16m colors), and then reprocess the image to reduce colors to 256, can I keep my white... white ?
Try, if you have a lot of white, white will be white
I tried, but white is not white.
I really have a lot of white though ! I'd say around 95% maybe.
Could you send me the PNG 16m?
Pierre.
Bingo
Posts: 25
Joined: Fri Sep 10, 2004 7:00 am

Post by Bingo »

Of course.
I'll send it to you tomorrow morning.
Bingo
Posts: 25
Joined: Fri Sep 10, 2004 7:00 am

Post by Bingo »

OK, pm sent with link to the image.
Thanks for helping Pierre.
Bingo
Posts: 25
Joined: Fri Sep 10, 2004 7:00 am

Post by Bingo »

Pierre,
Have you found something new about this matter ?

Arnaud
User avatar
xnview
Author of XnView
Posts: 46236
Joined: Mon Oct 13, 2003 7:31 am
Location: France
Contact:

Post by xnview »

Bingo wrote:Have you found something new about this matter ?
Do you have received my reply by pm?
Pierre.
Bingo
Posts: 25
Joined: Fri Sep 10, 2004 7:00 am

Post by Bingo »

xnview wrote:Do you have received my reply by pm?
Yes I have.
You noticed that their was no problem when "-dither" was used, but I was wondering whether you had found a solution for non-dithered conversions ?

Best regards,
Arnaud
Bingo
Posts: 25
Joined: Fri Sep 10, 2004 7:00 am

Post by Bingo »

Pierre,

Are you planning on releasing a new build of nconvert ?
I am still in a test period, but I have to write batch jobs, and I would have liked to know whether I could write nconvert command lines, or if I had to write them using mogrify (which works but is horribly slow!!!).

Best regards,
Arnaud
User avatar
xnview
Author of XnView
Posts: 46236
Joined: Mon Oct 13, 2003 7:31 am
Location: France
Contact:

Post by xnview »

Bingo wrote:Are you planning on releasing a new build of nconvert ?
I am still in a test period, but I have to write batch jobs, and I would have liked to know whether I could write nconvert command lines, or if I had to write them using mogrify (which works but is horribly slow!!!).
But with the -dither, all is ok, no?
Pierre.
Bingo
Posts: 25
Joined: Fri Sep 10, 2004 7:00 am

Post by Bingo »

xnview wrote:But with the -dither, all is ok, no?
Yes, but the output is... dithered !
I do not want dithering in the output images, I need plain colors.
User avatar
xnview
Author of XnView
Posts: 46236
Joined: Mon Oct 13, 2003 7:31 am
Location: France
Contact:

Post by xnview »

Bingo wrote:
xnview wrote:But with the -dither, all is ok, no?
Yes, but the output is... dithered !
I do not want dithering in the output images, I need plain colors.
Yes, right. There is a problem because when i quantize picture, i reduce bits per component, so after white is no more white :-(
You can try with other software, you'll have same result.
But do you have same result with ImageMagick?
Pierre.
Post Reply