Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

how to check windows icon file for image quality

Tags:

windows

icons

I have recently used an icon file received from our marketing team. The icon file when opened in resource editor (Visual Studio 2008) looks like this.

enter image description here

The same file when opened-and-saved in IcoFX appears correctly in resource editor. enter image description here

My marketing team uses some tools (Picture2Icon ) in Mac and produces the icon file which appears to be corrupt or not fully correct. The same file saved by IcoFx seems to be correct. What is causing the ICOFX out to be correct?

The result is the exe shows bad icons. The exact case where the image is bad is not clear- It is reported in case where color quality is set to be 'medium' (windows XP). It is worse when executable is "selected" in windows explorer.

enter image description here

Here is one icon that shows problem: https://github.com/jayanmn/icontest/blob/master/icontest.ico

Full sample code to create exe is at https://github.com/jayanmn/icontest/

So question is given an ico file, how can I ensure that it works fine on WindowsXP, Windows Vista and Windows7?

like image 795
Jayan Avatar asked Jun 15 '12 06:06

Jayan


People also ask

What resolution are Windows icons?

Icons have a maximum size of 256x256 pixels, making them suitable for high-dpi (dots per inch) displays.

What file type do Windows icons use?

The ICO file format is an image file format for computer icons in Microsoft Windows.


1 Answers

I took a good look at your icontest.ico file provided from the GitHub website and discovered that the solution is an easy fix.

First, let me illustrate the problem as I see it on a Windows XP 32bit System using the freeware IrfanView software which is an excellent image viewer for this task.

Here is a composite shot I made illustrating the error for 5 of 6 layers as seen using IrfanView:

enter image description here


To fix the above icontest.ico file, one would think frames 1,2,3,4 and 6 are bad. But the opposite is true! It turns out that frame 5 is the culprit!.

Specifically, frame 5 has compression set on this frame which is causing the issue.

The actual fix that's required is to merely re-save the icontest.ico file without compressing that layer. For this task, the freeware GIMP application which is an excellent image editor is perfect for this task.

Just re-save the icon file with GIMP but remove the compression for the 5th layer as shown below:

enter image description here


The final result is a properly rendered icontestResaved.ico as seen in IrfanView (Tip: To view frames of an icon file in IrfanView, use the Red Arrows that's next to the frame number, i.e. 1/6): enter image description here

The best way to ensure that the file works in different Windows Operating System's is to actually have a machine available, as the rendering engine is unique and emulators might not work as intended.

For the curious: Setting all layers to be compressed in GIMP resulted in a icon that was not viewable in Windows Explorer.

Tip: To view the reference images above at original size, right mouse-click and choose View Image.

Status Update: Consider installing Axialis IconWorkshop™ Lite Version 6.3.1.1 to handle all your icon development workflow needs. It's a free Visual Studio 2008 Plugin provided by Axialis themselves!

like image 64
arttronics Avatar answered Oct 06 '22 21:10

arttronics