GNOME Bugzilla – Bug 342883
GIMP doesn't save ICO files properly when indexed
Last modified: 2008-01-15 13:08:14 UTC
Please describe the problem: When you save an image file as an ICO file when you index it, the file is saved as all black. Also, when saving as 4-bit ICO, the icon doesn't save properly as some details are left out. Steps to reproduce: 1. Open the XCF sample file I attached. 2. Index it (256 maximum colors with no dithering). 3. Save it as an ICO in 4, 8, or 32-bit color mode. 4. View the file by reopening it (the icon shown in the open recent dialog is okay, but seeing the opened image file in GIMP or via Windows Explorer is where it's all black. Actual results: The icon is saved as all black without any color at all. Expected results: The colors should be kept as is, unless there are more colors in the image than the palette can store where extras are merged into existing ones or deleted still leaving the image relatively in tact. Does this happen every time? As far as I can tell, yes. Other information: When saving into 4-bit mode without indexing it, the top 11 or so pixels are cut off, but the icon appears fine otherwise. This doesn't seem to apply to 8-bit or 32-bit mode.
Created attachment 66165 [details] Test case - Index it and save as ICO This is the test case. Just convert it to indexed mode and save as an ICO.
The plug-in doesn't seem to handle indexed images very well. You are better off starting with an image in RGB mode.
Fixed in the both branches. Dude, this code urgently needs a cleanup. 2006-08-24 Sven Neumann <sven@gimp.org> * plug-ins/winicon/icodialog.c * plug-ins/winicon/icosave.c: fixed handling of indexed images (bug #342883).