I’ve got a few questions about JPEG’s that I can’t seem to find easy answers for.
Have they changed the nature of JPEG’s recently? I have an older Photoshop-esque type program, and it doesn’t seem to be able to read some newer JPEG’s. Also, I seem to be getting a lot of “UNSUPPORTED START OF FILE MARKER” and “UNSUPPORTED OR BAD JPEG TYPE” prompts as well from images I’ve picked up off the web.
What’s up with my JPEG’s bieng larger (from a memory standpoint) than bitmaps? I was always taught that you should do your artwork in RGB Truecolor bitmaps, and then convert them to JPEG to conserve memory.
Don’t know about the first, though I bet a quick google search would tell you if there was such a change.
But on the second, I have to wonder what you’re doing to make JPEGs bigger than bitmaps. Bitmaps use no compression, and so should almost never be smaller than the JPEG of the same image. The only way I can think of that to happen is if you are dealing with very small (pixels-wise) images, and the JPEG header might take up more room than you save with compression. But that’s so unlikely as to be ridiculous.
No, but I feel your pain. I recently wrote some custom functions to manipulate jpegs in a very specific way. Without getting into too many technical details, the image file contains headers that help applications determine things like color depth, compression level, and dimensions. For most newer, professional programs, these values can be mangled, and the program will still be able to interpret and display the image. Older programs are not as forgiving. Many image editors are not mindful of the proper format for these headers or ignore them - leading to “corrupt” files - corrupt in the sense that they are not jpegs according to the spec, but close enough to be interpreted as such. You can obtain some programs on the internet that clean these headers up for you. Do a google search.
Well, in a 1:1 comparison, jpegs should never be larger than bitmaps. I suspect that your jpegs may be using a much higher color depth than an equivalent bitmap. The color difference may not be noticeable directly, but it will require more space.
If your jpeg compression factor is set to 100, then the files will be as large as a bitmap. Try a compression factor of 75 when you’re ready to show the image. (The image should be saved in a lossless format when you’re still working on it).
I’m not sure if anything too new has been happening with the JPEG specification, though as you suspected, your older graphics software may be incompatible:
Also, some JPEGs are saved in a progressive format so that an image is displayed in multiple passes, with each showing more resolution (rather than in a single scan from top to bottom), and this same book mentions compatibility issues with this format, so that may be part of your problem, too.
Thanks for all the help. One of the mystery’s might be solved.
The JPEG’s which use more memory than bitmaps were indeed very small (60X60 pixels – tiny little things I use as texture maps). A programmer friend opened one up in notepad and looking at the code noticed that the program I was using added a lot of junk text (“This image created with Ulead Image Pad…” etc.) and besides that, the program gave me no compression options. Time to move up to a new program.
I don’t know how much of a factor this is, but keep in mind that some programs recognize “.jpg” and “.jpeg” files as “different” (not VERY different, mind you…). This may cause quirks. I dunno. Just a thought.
Throw GraphicConverter at it (if you are on a Mac); GraphicConverter is like a graphics file can opener. It’ll display 2/3 of a JPEG if the download was interrupted.
AHunter3, all my programs do that, including IE5. I can’t see anything remarkable about it.
Spoofe, I may be wrong but I believe a program does not take the information from the file name or extension but rather from the internal header. The extension tells the operating system how to handle the file like the default program etc.
Among other programs I use Irfan, which I recommend. If you give it a file of one type with an extension of a different type, it will give you a message “hey, this file is JPG but has a BMP extension, wanna change it?”
Some file types have no headers and can only be recognized by the extension.
I used to write image conversion programs, long ago, in the DOS days Our programs auto-detected the file type, but it wasn’t easy.
Most DOS/Windows image display/manipulation/conversion programs do indeed use the extension to determine the file type. They do this because there are several image file formats which don’t have any “magic numbers” to help a program recognize the file. And even of the formats which do have magic numbers, they’re not all in the same place. Which means that it’s possible, albeit unlikely, that data from one image type can look like the magic number of a different image type.
Irfanview is the best modern program I’ve seen at automagically detecting the file type.