Page 1 of 2

BMP color index

Posted: Tue Feb 06, 2007 6:26 pm
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.

Re: BMP color index

Posted: Tue Feb 06, 2007 7:12 pm
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?

Posted: Tue Feb 06, 2007 8:42 pm
by sheldon
Of course, here it is:
http://www.oc-forum.org/img/1.bmp

Posted: Tue Feb 06, 2007 10:56 pm
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.

Posted: Wed Feb 07, 2007 3:18 pm
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 :-)

Posted: Wed Feb 07, 2007 8:38 pm
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.

Numbered---

Posted: Wed Feb 07, 2007 9:49 pm
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

Posted: Wed Jun 06, 2007 9:30 pm
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

Posted: Wed Jun 06, 2007 10:10 pm
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.

Posted: Wed Jun 06, 2007 11:04 pm
by Drahken
That bmp works fine for me, and I have that compose with alpha setting turned on.

Posted: Wed Jun 06, 2007 11:15 pm
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

Posted: Wed Jun 06, 2007 11:52 pm
by xnviewuser
I see. Do you have any ideas about what I should do?

Posted: Thu Jun 07, 2007 12:01 am
by Drahken
Are you using xnview 1.91?

Posted: Thu Jun 07, 2007 12:02 am
by xnviewuser
Drahken wrote:Are you using xnview 1.91?
Yes.

Posted: Thu Jun 07, 2007 12:13 am
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.