OS2 World Community Forum

OS/2, eCS & ArcaOS - Technical => Multimedia => Topic started by: Martin Iturbide on December 19, 2017, 11:14:07 pm

Title: Saving OS/2 icons - OS/2 icon format in 2017
Post by: Martin Iturbide on December 19, 2017, 11:14:07 pm
Hi

Just checking some other forum thread I became with this issue I always have about OS/2 icons. If I would like to save an icon in OS/2 format in 2017, on a modern display and resolution, which format should I have to select on IconEditor ?

For example, I had been saving some Icons on "Independent Small Color Form", in 1.x format and at 128x128 (I don't care much about the file size). And I had been using both IconEdit and PMView .

I know that if I save it on 2.x format it will show fine on the desktop, but it will be broken on IconEdit (Seems to be a limitation on IconEdit).

What is your experience with OS/2 formatted icons?

Regards
Title: Re: Saving OS/2 icons - OS/2 icon format in 2017
Post by: David Graser on December 20, 2017, 06:47:44 am
I am no expert.  Everything I know is from my experience and trial and error.

To start, you need to create a good template.  I have attached a folder icon that I use for a template.  I believe someone far more knowledgeable than me created it.  I have attached a picture of the settings and icon sizes.  Each OS/2 icon can contain multiple size icons and each used for different display resolutions.  If done in one size, the operating system will try to do its best to render it in the size required for the display setting.  Hi resolutions use 40x40 and 20x20 icons.  The lower display settings such as 600x800 use the 32x32 and 16x16 icons.  I believe OS/2 can render in 64x64, however, I am not sure when the operating system would utilize it. It can be deleted from the grouping.

Using this template, the picture copied is pasted and rendered as it should be.   Any white or light grey edges will be rendered white when displayed by the operating system.  If you don't want a white edge, these pixels will need to be deleted or darkened.

I have found that PMView does the best job rendering 64x64 pngs to smaller sizes before copying to the icon editor.

I use PMView to a resize a 64x64 to 32x32 and then copy it the the 32x32 icon setting in the icon editor.  I do this for each size.

As you can see, doing and icon is a lot of work. I wish the icon editor could do 1/2 pixels. This would eliminate the rough edges that are found in OS/2 icons.

Remember, I am no expert.  I could have some of my facts wrong.  Feel free to correct me.

David
Title: Re: Saving OS/2 icons - OS/2 icon format in 2017
Post by: David Graser on December 20, 2017, 06:48:52 am
The picture
Title: Re: Saving OS/2 icons - OS/2 icon format in 2017
Post by: David Graser on December 20, 2017, 06:36:11 pm
I have attached a zip file containing a few of the icons I have created using this template in the past.  Enjoy. 

David
Title: Re: Saving OS/2 icons - OS/2 icon format in 2017
Post by: RickCHodgin on December 20, 2017, 07:15:41 pm
I have attached a zip file containing a few of the icons I have created using this template in the past.  Enjoy. 

What is the license for using these icons?  Is it Public Domain?
Title: Re: Saving OS/2 icons - OS/2 icon format in 2017
Post by: David Graser on December 20, 2017, 10:22:23 pm
Rich

I created these icons anywhere from 4 to 7 years ago.  I haven't really done anything since until I started messing with a new xcenter shadow icon. The package itself is assorted.  Quite a few are strictly my design.  Some were created by me cropping something from an advertisement I liked, pasting, and modifying it to something that looked presentable under OS/2. Some are based on free PNGs.  Just about all have been modified, added to, or enhanced to make it work as an OS/2 icon.  I have hundreds I created for the eComstation eschemes.  eSchemes doesn't work under ArcaOS.   Anything I have always done is free for everyone and they can use, modify and enhance them anyway they want which makes things less complicated,
Title: Re: Saving OS/2 icons - OS/2 icon format in 2017
Post by: Andreas Kohl on December 20, 2017, 10:38:24 pm
The picture
I cannot see any reason to use  24bit/Pixel for 16x16 sized icons? And for 80% of 20x20 sized icons it would be questionable.

It depends on the intended audience. For desktop usage OS/2 2.x recommends 5 different units (covered by the mentioned Icon Editor) and OS/2 Warp adds 2 additional units. It should follow the CUA style guide. It doesn't differ much from Mac, Motif or Windows.
Title: Re: Saving OS/2 icons - OS/2 icon format in 2017
Post by: David Graser on December 20, 2017, 11:35:08 pm
The picture
I cannot see any reason to use  24bit/Pixel for 16x16 sized icons? And for 80% of 20x20 sized icons it would be questionable.

It depends on the intended audience. For desktop usage OS/2 2.x recommends 5 different units (covered by the mentioned Icon Editor) and OS/2 Warp adds 2 additional units. It should follow the CUA style guide. It doesn't differ much from Mac, Motif or Windows.

The problem occurs when the picture is pasted to the 16x16 and 20x20.  If that color is not in the palette, some off the wall color or colors are used.  Using 24bit, icon editor has no problem rendering the correct color(s).   However, you are correct in that it might much simplier to make the smaller icons with few colors.
Title: Re: Saving OS/2 icons - OS/2 icon format in 2017
Post by: Dave Yeo on December 21, 2017, 01:22:18 am
One other problem, when icons are embedded in an application, is that hi-colour icons get corrupted if fed through lxlite. With Mozilla, we had to switch to 8 colour icons IIRC when we switched to linking with wlink and using lxlite to strip/compress the binaries.
Title: Re: Saving OS/2 icons - OS/2 icon format in 2017
Post by: David Graser on December 21, 2017, 02:40:44 am
One other problem, when icons are embedded in an application, is that hi-colour icons get corrupted if fed through lxlite. With Mozilla, we had to switch to 8 colour icons IIRC when we switched to linking with wlink and using lxlite to strip/compress the binaries.

Dave

You don't use bitmaps for the embedded graphics?  I know programs like FM/2 and Filstar 2 use embedded bmps.
Title: Re: Saving OS/2 icons - OS/2 icon format in 2017
Post by: Dave Yeo on December 21, 2017, 03:33:22 am
Things like the icon on your desktop is a plain icon, added to the executable as a resource, most of the rest are pngs.
Title: Re: Saving OS/2 icons - OS/2 icon format in 2017
Post by: Andreas Kohl on December 21, 2017, 04:20:36 am
The problem occurs when the picture is pasted to the 16x16 and 20x20.  If that color is not in the palette, some off the wall color or colors are used.
That's the correct behaviour for the System palette. No big difference under Windows. Good icon editors offer palette management functions. But it's about 196 and 324 different pixels (theoretically).

Quote
Using 24bit, icon editor has no problem rendering the correct color(s).   However, you are correct in that it might much simplier to make the smaller icons with few colors.
It depends on the display driver and the representation. Colour management can be tricky between Windows/OS2 and Mac or UNIX.
Title: Re: Saving OS/2 icons - OS/2 icon format in 2017
Post by: Martin Iturbide on December 21, 2017, 03:12:05 pm
Thanks for the replies.

For the moment it seems to me that David's suggestions is the best to maintain "IconEdit compatiblility". Even that an 128x128 icon may work (created with PMView) and displays on the screen, it generates some problems with IconEdit. So I guess I should stick to 32x32 as max for OS/2 icons.

IconEdit may open 128x128 icon but if you add more "devices", or try to save it as 2.0, it will start showing problems.

Regards
Title: Re: Saving OS/2 icons - OS/2 icon format in 2017
Post by: Alex Taylor on December 21, 2017, 08:27:36 pm
In my experience, the best way to produce colour-accurate icons is to create them as 24-bit bitmaps first. This requires using a 'placeholder' background colour in place of what will end up as transparent areas (this should be a colour that doesn't otherwise appear in the image; I normally use light magenta).

Then, open the bitmap in Embellish and convert it to Palette mode – this will down-convert it to 8-bit colour.  Embellish usually (about 95% of the time in my experience) does a better job of this than PMView, although it depends on the image.  Save the bitmap, preferably under a new filename.

Then, open the image in PMView. If it's not already cropped to the correct size, do so now (do NOT resize it, however, as this will undo the colour down-conversion and you'll have to repeat the previous step with Embellish again).  Then copy the image into the clipboard from PMView.  Open a blank icon file template which has the correct resolution already defined and selected (e.g. 40x40, 8-bit palette) and paste the image in.  Assuming the clipboard image dimensions exactly match the icon's image dimensions, the palette in Icon Editor will automatically be converted to match the image in the clipboard.  This only seems to work if you used PMView to copy the image – I'm guessing PMView knows how to add the palette information to the clipboard alongside the image.

Finally, in the Icon Editor, replace the placeholder colour with transparent background.
Title: Re: Saving OS/2 icons - OS/2 icon format in 2017
Post by: Joop on December 22, 2017, 02:11:55 pm
I played a lot with IconEditor. With the right template you can go up to 256x256 icons. You can save them too, you can use them too, but OS/2 or eCS will downsize it to 40x40. So what's the point? Always work in 24 bit, even if its much less. Has to do with colors which are not in the palette and I refuse to make separate palettes for each icon. Usually it will take less then five minutes to make an icon with 16x16, 20x20, 32x32 and 40x40. You have to remember that in the editor things show ugly and rough, but as soon as it is started as an icon at the right size it looks rather smooth. I never got 2.0 working, somewhere in the editor its disabled. I'm working mostly with PMView and IconEditor, when it totally sucks I try Embellish > PMView > IconEditor. Key to good icons is go first to a square with sizes which can be divided to the right size. Example 256 > 128 > 64 >32 > 16 and 320> 160> 80> 40> 20. You can start bigger. If it isn't these value's or bigger,  first make it so in the highest resolution because you won't see the loss in the smaller one's. If you don't start with these sequence, its not necessary to start with 320, 256 or less, you will end up in the icon size with losses which will give rough edges or can damage the appealing factor. Mind that small things are not noticeable, so your icon must consist of simple things which are also recognizable when its 20x20 or 16x16.   
Title: Re: Saving OS/2 icons - OS/2 icon format in 2017
Post by: Martin Iturbide on December 22, 2017, 09:17:02 pm
Hi Joop.

I followed your advice, 24bits and your suggestion resolution (16x16, 20x20, 32x32 and 40x40) and I'm doing fine.  If I add the 128x128 resolution, the icon also works on OS/2. (Saving it as 1.2)

But does anyone notice that if you add some resolution like 64x64, in my case, the icon will no longer render on the desktop and will show the "default icon". Is that something that depends on the video hardware, the driver or everyone else see the same thing?

For example, attached here, "taskbar-2.ico" renders ok, but "taskbar.ico" does not render on the OS/2's desktop. Both can be opened with IconEdit, but only "taskbar-2.ico" is show as a desktop icon.

Regards
Title: Re: Saving OS/2 icons - OS/2 icon format in 2017
Post by: dumpandpump on December 23, 2017, 09:04:26 am
"taskbar.ico" does not render on the OS/2's desktop.

</silence>

It does with another OS/2, but first you'll have to delete the next best matching sizes of (IIRC) 64x64 and 48x48 too. With 16x16, 20x20, 32x32, 40x40 and 128x128 it works as expected. There is an unverified, guessed possibility that 128x128 doesn't match the preferred 40x40, and that the OS selects the next largest size just once. This isn't an expected size, hence a default icon instead of a 64x64 or 40x40 icon. Changing the order of sizes may help.

So apparently a fully working icon file can include the size 128x128, but not all possible sizes of PNG icon files of Unix ports.

<silence>
Title: Re: Saving OS/2 icons - OS/2 icon format in 2017
Post by: dumpandpump on December 23, 2017, 09:18:41 am
Mind that small things are not noticeable, so your icon must consist of simple things which are also recognizable when its 20x20 or 16x16.

</silence>

No, it mustn't. In lazy mode an unmodified image which was nothing but resized may stop being recognizable indeed, but some apps (including IBM's) do use different images for different sizes. If, for example, the brand name "Joop!" looks good in 40x40 mode, then one could use the same font's "J!" in 16x16 mode.

Regarding small details, it can be enough to suggest a shape too, just like a 16x16 "Jeep!" will probably look like a 16x16 "Joop!". An advantage of small sizes is that's harder to notice such a difference too, as long as "Joop!" itself is iconic on its own.

<silence>
Title: Re: Saving OS/2 icons - OS/2 icon format in 2017
Post by: Andreas Kohl on December 23, 2017, 05:25:45 pm
So apparently a fully working icon file can include the size 128x128, but not all possible sizes of PNG icon files of Unix ports.
Sorry, that sounds strange. I don't know what you mean by "Unix ports" here. I'm using UNIX daily and no standard window system is using "PNG icon files". The "Icon Editor" in an UNIX desktop environment simply uses xpm files (*.pm) for coloured and xbm (*.bm) for monochrome icons.