BMP color index

Ask for help and post your question on how to use XnView Classic.

Moderators: helmut, XnTriq, xnview

sheldon
Posts: 3
Joined: Tue Feb 06, 2007 6:21 pm

BMP color index

Post by sheldon »

Welcome,
at first - sorry for my english, it's my foreign language.
I have a problem with converting lots of BMP files into GIF.
Those BMPs are white backgrounds with black/gray elements on it. While converting, I have to change te background=white color into transparent.
What color index should I enter in te config section for saving gif (or png) files?
I tried 0, 1, FFFFFF, #FFFFFF but it doesn't work. When I enter 0 - it converts black into transparent.
White in those BMPs is RGB 255,255,255 = #FFFFFF

I'll be glad, if you can help me.
I don't want to reedit & convert 7500 files manually ;-)

Greetings from Poland,
Mateusz.
User avatar
xnview
Author of XnView
Posts: 46235
Joined: Mon Oct 13, 2003 7:31 am
Location: France
Contact:

Re: BMP color index

Post by xnview »

sheldon wrote:Welcome,
at first - sorry for my english, it's my foreign language.
I have a problem with converting lots of BMP files into GIF.
Those BMPs are white backgrounds with black/gray elements on it. While converting, I have to change te background=white color into transparent.
What color index should I enter in te config section for saving gif (or png) files?
I tried 0, 1, FFFFFF, #FFFFFF but it doesn't work. When I enter 0 - it converts black into transparent.
White in those BMPs is RGB 255,255,255 = #FFFFFF

I'll be glad, if you can help me.
I don't want to reedit & convert 7500 files manually ;-)
Perhaps you could post a sample?
Pierre.
sheldon
Posts: 3
Joined: Tue Feb 06, 2007 6:21 pm

Post by sheldon »

Of course, here it is:
http://www.oc-forum.org/img/1.bmp
User avatar
Drahken
Posts: 884
Joined: Sun Apr 10, 2005 4:29 pm

Post by Drahken »

In that example, you want palette index 122. However, that may change from one image to the next.
There are 2 other ways to achieve this end:
1) This one requires a couple extra steps, but is the most effective if you are not completely sure which color you're looking for: Click Image->convert to colors->256(adaptive). Now Click image->edit color map. Choose the color you think you want and then click the set transparency box. NOTE: Make sure to uncheck the "set transparency value" box in the save options, or it'll set the wrong color.
2) Click file->export, choose the gif tab, and again choose 256(adaptive), then click the set transparency button.

In method #1, you will see the effect of your color choice once you click OK, and can easily change it if it's not right. In method #2, you won't be able to see the effect of your choice until you save and then reopen the image.
sheldon
Posts: 3
Joined: Tue Feb 06, 2007 6:21 pm

Post by sheldon »

Thanks Drahken, it works, but... It looks like I'll must convert all those files manually :-(
Is there an availability to mass-convert my bmp files into 256colors bmp's? Then another mass convert with set-transparency-option and that's all.

There are over 7500 small files :-(

Big thanks to all of you, for present and future help :-)
User avatar
Drahken
Posts: 884
Joined: Sun Apr 10, 2005 4:29 pm

Post by Drahken »

1) Converting to 256 colors is easy. Click tools->batch conver OR sequence convert (never could figure out just what the difference was between the two). Select input files/directory, output directory, output filetype, etc. Then click the transformations tab->convert->colors. You can set some color options (like how many colors and whether or not to dither (do NOT dither, it'll look bad and transparency won't work properly (if at all)) by selecting it where it appears in the right hand box. You shouldn't need to change anything though, it should default to 256 colors and no dither.
2) If the color you want transparent is the same in each image, you can do that automatically too (just set the transparent palette entry for 122 on the save options). In fact, you can even do it in the same process as converting to 256 colors. However, if the color isn't in the same palette entry for each one, then the only way to do it is one image at a time.

You can convert it to gif or png in this same process, just select it as the output format. Png files will have a slightly smaller size, but it won't make a major difference whether you choose png or gif.
User avatar
Clo
XnThusiast
Posts: 4441
Joined: Sun Oct 17, 2004 4:57 am
Location: Bordeaux, France
Contact:

Numbered---

Post by Clo »

—> Drahken

:) Hello !
…batch convert OR sequence convert (never could figure out just what the difference was between the two).
• Originally, Sequence convert stood for a bunch of files having a numbered naming… Example in our Manual :
With the "Sequence Convert" command -from the "Tools" menu-,
you can convert an increasing numbered order file-group like:
• file001.png
• file002.png
• file003.png etc. …

:mrgreen: KR
Claude
Clo
Old user ON SELECTIVE STRIKE till further notice
xnviewuser

Post by xnviewuser »

Hello!

I use Media Player Classic to save a frame from a film. If I use BMP for export format I can not view in XnView (the picture is absolutely black) but it seems fine in Paint, Paint.NET or Photoshop. When I overwrite the BMP in Paint.NET XnView is able to show rewritten new picture. It seems to me that BMP Media Player Classic exports is 32 bit and Paint.NET's is 24 bit. So XnView is unable to show 32 bit BMPs? My XnView version is 1.91.
I uploaded a file here: http://rapidshare.com/files/35647855/sn ... 8.bmp.html
User avatar
XnTriq
Moderator & Librarian
Posts: 6512
Joined: Sun Sep 25, 2005 3:00 am
Location: Ref Desk

Post by XnTriq »

xnviewuser wrote:So XnView is unable to show 32 bit BMPs?
Go to Tools » Options... » View » View and deactivate Use transparent index (<=8bits) or alpha channel.
User avatar
Drahken
Posts: 884
Joined: Sun Apr 10, 2005 4:29 pm

Post by Drahken »

That bmp works fine for me, and I have that compose with alpha setting turned on.
User avatar
XnTriq
Moderator & Librarian
Posts: 6512
Joined: Sun Sep 25, 2005 3:00 am
Location: Ref Desk

Post by XnTriq »

Drahken, could you please do a few tests with the Auto image size settings on your system?

:arrow: Some gifs changes their background when zoomed in/out
xnviewuser

Post by xnviewuser »

I see. Do you have any ideas about what I should do?
User avatar
Drahken
Posts: 884
Joined: Sun Apr 10, 2005 4:29 pm

Post by Drahken »

Are you using xnview 1.91?
xnviewuser

Post by xnviewuser »

Drahken wrote:Are you using xnview 1.91?
Yes.
User avatar
Drahken
Posts: 884
Joined: Sun Apr 10, 2005 4:29 pm

Post by Drahken »

Hmm.... When you open that image, are you opening it at full zoom? Taking a hint from xntriq's last post, I tried zooming out on your pic & it disappeared. I unchecked the compose with alpha option, and everything went back to normal. I would definitely try turning that off.

If you still have problems, try batch converting a couple of those images into JPG or PNG or whatever, then open the images you just created. Just because there's an issue displaying an image doesn't always mean that there's an issue reading the image. Sometimes an image will convert without difficulty, even if it displays wrong.
Post Reply