image color depth

Place to discuss Fedora and/or Red Hat
Post Reply
Stryker
scripter
scripter
Posts: 98
Joined: Thu Jan 23, 2003 8:50 pm
Contact:

image color depth

Post by Stryker » Thu Oct 30, 2003 10:57 pm

Well, i'm trying to get an image I made with the gimp to a different color depth. I want to use it as a splash image during boot, and it has to be 16 bit... it's currently 24 bit. I can't find an option anywhere in the gimp to change it, if there's one that'd be great... but if there isn't is there a command to do it? I looked at convert and "depth" was a little vague, i thought it could mean something other than color depth so i tried it as a test and the converted image didn't work... so i'm assuming it wasn't the color depth. Any ideas to change it to 16 bit?

User avatar
Void Main
Site Admin
Site Admin
Posts: 5716
Joined: Wed Jan 08, 2003 5:24 am
Location: Tuxville, USA
Contact:

Post by Void Main » Fri Oct 31, 2003 9:06 am

I will have to make a few assumptions here since you left out a lot of details. Since this is in the Red Hat forum and you don't mention a specific boot loader I will assume you are using a stock/default Red Hat 8/9 boot loader of GRUB. If GRUB is indeed what you are using then I assume you want to change that blue background image at the GRUB boot menu to something else. Here is a good HOWTO:

http://ruslug.rutgers.edu/~mcgrof/grub-images/

Now, there is another way to have a graphical boot using framebuffer called "bootsplash" but that has to be installed separately. I believe it comes default with Gentoo. There are also a couple of other methods. Mandrake uses some type of graphical mode boot, not sure if it uses bootsplash or not. I also have installed SuSE's LILO on Red Hat along with another utility to get a nice graphical animated boot screen but I can't remember the name of it. I can find it if you like.

Tux
guru
guru
Posts: 689
Joined: Wed Jan 08, 2003 10:40 am

Post by Tux » Fri Oct 31, 2003 9:18 am

Wasn't bootsplash developed by SUSE?

ah, that reminds me Void, you need to change the SuSE forum to 'SUSE' as this is what they are now known as...

User avatar
Void Main
Site Admin
Site Admin
Posts: 5716
Joined: Wed Jan 08, 2003 5:24 am
Location: Tuxville, USA
Contact:

Post by Void Main » Fri Oct 31, 2003 9:53 am

I don't belive SUSE developed it but anything is possible. I believe they did something similar but I thought it was named something else. Here is the animated SUSE thing I used before:

http://www.gamers.org/~quinet/lilo/help.html

Here is the bootsplash web site:

http://www.bootsplash.org/

I'll fix the SuSE->SUSE thing...

Stryker
scripter
scripter
Posts: 98
Joined: Thu Jan 23, 2003 8:50 pm
Contact:

Post by Stryker » Sat Nov 01, 2003 12:41 am

thanks void main, but i wasn't talking about the grub part. Has nothing to do with the bootloader. It's the splash screen seen during boot. I ask in the redhat section as redhat is what i'm using to edit this image... all i need is to make it 16 bit. I actually got it to work as 24bit somehow, but i'm still intrested in how to change the color depth of images.

User avatar
Void Main
Site Admin
Site Admin
Posts: 5716
Joined: Wed Jan 08, 2003 5:24 am
Location: Tuxville, USA
Contact:

Post by Void Main » Sat Nov 01, 2003 12:46 am

You're telling me that the boot loader has nothing to do with the splash screen seen during boot? I'm really confused on that one. I guess I don't understand what splash screen you are talking about, and you don't mention what image format you are working with. There is an example in that link on how to change the color depth using "convert".

Stryker
scripter
scripter
Posts: 98
Joined: Thu Jan 23, 2003 8:50 pm
Contact:

Post by Stryker » Sat Nov 01, 2003 1:03 am

the example showed me how to convert it to 14 colors, not sure how many colors are in 16 bit... i suppose i can look that up. sorry i forgot the type, very silly of me. it's a jpeg. the splash screen is the point after the bootloader up until you get to the login prompt... you can have a splash screen with an image to make it more friendly for the desktop users, while having an option to press a key to go to verbose mode. very nifty i think.

User avatar
Void Main
Site Admin
Site Admin
Posts: 5716
Joined: Wed Jan 08, 2003 5:24 am
Location: Tuxville, USA
Contact:

Post by Void Main » Sat Nov 01, 2003 1:26 am

1 bit = 2 colors
4 bit = 2*2*2*2 = 16 colors
8 bit = 1 byte = 2*2*2*2*2*2*2*2 = 256 colors
16 bit = 2 bytes = 256*256 = 65,535 colors
24 bit = 3 bytes = 256*256*256 = 16,777,216 colors
32 bit = 4 bytes = 256*256*256*256 = 4,294,967,296 colors

However, I believe the JPG format is 24 bit period and can't be changed. You can change the compression level of JPEG but not the depth as far as I know. GIF can be 1, 4, or 8 bit. PNG can go up to 48 bit color. There are formats that have different color depths like PNG, bitmap (BMP), pixmap (xpm), etc. Now I am curious, how/what/where are you setting up this image to be displayed at boot if you are not doing it via the boot loader process?

To convert your 24 bit JPG to a 16 bit PNG I would:

convert -colors 65535 file.jpg newfile.png
Last edited by Void Main on Sat Nov 01, 2003 1:46 am, edited 1 time in total.

Stryker
scripter
scripter
Posts: 98
Joined: Thu Jan 23, 2003 8:50 pm
Contact:

Post by Stryker » Sat Nov 01, 2003 1:45 am

from http://manual.gimp.org/manual/GUM/file_and_save2.html
· JPEG (Joint Photographic Experts Group): This format supports compression and works at all color depths. The image compression is adjustable, but beware: Too high a compression could severely reduce image quality, since JPEG compression is lossy. Use JPEG to create TrueColor Web graphics, or if you don't want your image to take up a lot of space. JPEG is a good format for photographs.
bootsplash.org has a modification you can add to the kernel to allow it to boot with graphics, graphics with a progress bar, or a background image to the text. Very nice I think. The image is attached at the end of the initrd file using the splash utility which you can get from their site.

User avatar
Void Main
Site Admin
Site Admin
Posts: 5716
Joined: Wed Jan 08, 2003 5:24 am
Location: Tuxville, USA
Contact:

Post by Void Main » Sat Nov 01, 2003 1:59 am

If you notice they say "works at all color depths". To me that means it can be displayed at any depth. The image itself is 24 bit. Everything I have seen states 24 bit, like:

http://www.smartdraw.com/resources/cent ... imize5.htm
JPEG
The JPEG (short for Joint Photographic Experts Group) file format is the best way to compress photographs for web publication. JPEGs store images in 24-bit color (GIFs only use 8 bits or less) allowing you to save millions of colors. Consequently, JPEGs are better suited for photographs and images with fine gradations of tone and color. Most digital cameras also use the JPEG format to store images.
And that's the way I've always understood it. As far as bootsplash, I thought you were using something other than what I had linked to above from the sounds of it. I believe I had attempted to get it to work a while back with no success. I am glad you were able to get it to work.

Stryker
scripter
scripter
Posts: 98
Joined: Thu Jan 23, 2003 8:50 pm
Contact:

Post by Stryker » Sat Nov 01, 2003 2:02 am

that's strange how the site would tell me it has to be a 16 bits though. And it has to be a jpeg... maybe i misunderstood and it meant it would only show 16 bit quality. anyways, at least i got that figured out. now i'm off to explore the progress bar part of it.

User avatar
Void Main
Site Admin
Site Admin
Posts: 5716
Joined: Wed Jan 08, 2003 5:24 am
Location: Tuxville, USA
Contact:

Post by Void Main » Sat Nov 01, 2003 2:07 am

Can you give me a link to the spot where it says that?

Stryker
scripter
scripter
Posts: 98
Joined: Thu Jan 23, 2003 8:50 pm
Contact:

Post by Stryker » Sat Nov 01, 2003 2:29 am

taken from http://www.bootsplash.org/faq.html
6) it seems that the display needs to be in 16bpp mode for the bootsplash to work -- is this correct?

Currently the bootsplash only works with 16bit. It's still outstanding to implement at least 24bit depth as well. But as you dont get that much out of it (except nicer gradients and 50% higher memory consumption) this has not been done yet. For the vesa framebuffer you can specify i.e. vga=791 for 1024x768.
Implementing other bit depths than 16bit, and other picture loaders than the jpg one are things that come to the mind. Also the userspace utility needs nicer config files. There is currently no code that works with 2.5.
I just was reading too fast and got confused was all I think... the display has to be in 16 bit, not the image itself.

User avatar
Void Main
Site Admin
Site Admin
Posts: 5716
Joined: Wed Jan 08, 2003 5:24 am
Location: Tuxville, USA
Contact:

Post by Void Main » Sat Nov 01, 2003 2:40 am

Yep, that's what I thought. I'm glad you were able to quote it to clear up the confusion. Let me know how the bootsplash thing goes for you. Maybe I'll have to give it another shot.

Tux
guru
guru
Posts: 689
Joined: Wed Jan 08, 2003 10:40 am

Post by Tux » Sat Nov 01, 2003 10:16 am

Void Main wrote:1 bit = 2 colors
4 bit = 2*2*2*2 = 16 colors
8 bit = 1 byte = 2*2*2*2*2*2*2*2 = 256 colors
16 bit = 2 bytes = 256*256 = 65,535 colors
24 bit = 3 bytes = 256*256*256 = 16,777,216 colors
32 bit = 4 bytes = 256*256*256*256 = 4,294,967,296 colors
Or, more simply, 2 to the power of the no. of bits:

eg. 2^16 = 65536

Well, i find it easier to think of it like that.

Post Reply