This one is because of a question I had someone ask me and I thought it might help out others so I figured I'd talk about the subject. Basically I've done quite a few different posts on various aspects of image manipulation. In fact I may focus a bit too much on the subject from time to time, but it's something that I find interesting. Anyway, while I've shown some of the more interesting aspects of the GDI+ code, I've never really talked about the subject of pixel formats or even image formats and how they're handled. Mainly because it's a fairly boring subject but I might as well cover it.
In GDI+, we generally use either the Bitmap or Image classes. When creating a Bitmap object, we can set the pixel format for the image (one of the constructors excepts it along with the height/width). There are a few of these but they're all fairly similar. For example, there is a format called Format16bppArgb1555. This format, is a 16-bit format that reserves one bit for the alpha channel and 5 bits each for the green, red, and blue channels. The listing of the various formats that are available can be found here. You may want to note that there is a format for 48-bit and 64-bit images. There is an issue though as it converts it down to a 24/32-bit image when you save it again. Other than this exception, once you've set the pixel format for that object, you're stuck with that format. The only way to convert it is to create a new image and copy the data over.
Image formats on the other hand are quite simple to deal with and converting from one to the other is easy. Generally when loading an image, it doesn't matter what the file format is (assuming of course that it's supported). With saving a file though, you may want it to be in a specific file format. For instance, since most of what I do at work is web related, I save a lot of things as JPEGs or PNGs. Now if I load up a Bitmap object with an image and then just try to save it as a JPEG, I'll run into an issue (anything that I load it in will say that it's not a jpeg, it may still load but it will throw up that warning). The reason for the issue is that it didn't save it as a JPEG. Instead the image is simply a bitmap file. The reason for that is that I never told it what format to save the image as and it simply used its default which is a bitmap. In order to fix this the Save function of the Bitmap class can take in a second object of type ImageFormat. This, as the name suggests, determines the format of the image. This is however not an enumeration, but a class. Thankfully there are some predefined definitions for us to use that can be found here. They're static members so you don't have to create anything yourself. Although if the format you want isn't listed, you're going to have to create your own definition (basically your own file loader). It's not a fun process...
Anyway, that's it. With that information you should be able to get the file to the specific format that you want. Sorry that there isn't any code on this one, but hopefully it helps someone out a bit. Anyway, give it a try, leave feedback, and happy coding.