Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / lazarus / 2017-02

LCL High-DPI request for help adding images

20 messages · 8 people · –

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Ondrej Pokorny

Update: I worked further today (unfortunately...)

I also added icon scaling support to the IDE. The IDE now can load 150% and 200% versions of the icons. If a High-DPI icon is missing, the normal icon is upscaled (with the worst algorithm, but that's what is available in the IDE).

Request: search for volunteers who would add at least the most important IDE icons (open, save, desktops - basically what is visible in the coolbars). Please see images/README.txt for more info.

Note: the High-DPI icons are used only from 144DPI (150%) upwards. 120DPI (125%) uses the original icons (which is default on Windows, AFAIK).

Thanks
Ondrej

Reply by email

Torsten Bonde Christiansen
to Ondrej Pokorny

How do i use icon scaling for user project?

Regards
Torsten.

Ondrej Pokorny wrote 18 lines
Update: I worked further today (unfortunately...) I also added icon scaling support to the IDE. The IDE now can load 150% and 200% versions of the icons. If a High-DPI icon is missing, the normal icon is upscaled (with the worst algorithm, but that's what is available in the IDE). Request: search for volunteers who would add at least the most important IDE icons (open, save, desktops - basically what is visible in the coolbars). Please see images/README.txt for more info. Note: the High-DPI icons are used only from 144DPI (150%) upwards. 120DPI (125%) uses the original icons (which is default on Windows, AFAIK). Thanks Ondrej

Reply by email

Ondrej Pokorny
to Torsten Bonde Christiansen
Torsten Bonde Christiansen wrote
How do i use icon scaling for user project?

The LCL doesn't offer an automatic feature for that. You have to do it yourself - use different image lists for different scaling or load external images in the wanted scaling. The IDE does the same.

I don't know if an automatic solution (one multi-resolution image list) is even possible - because e.g. some Win32 controls require usage of the Win32-native imagelist.

Ondrej

Reply by email

Donald Ziesig
to Ondrej Pokorny: Update: I worked further today (unfortunately...) I also added icon scaling support to…

Hi Ondrej!

I downloaded the latest lazarus from svn. Then make bigide.

When I started lazarus, the CoolBar is empty (except for the Save icon which is the correct size). The component icons are definitely bigger than the last version, but appear more like 125% rather than the 150% that I would expect for 144 dpi.

I rebuilt the laz_images.res (at least the file time stamp changed) and the ide but there was no change in the empty CoolBar.

images/README.txt says:

To use a high-DPI icon, register the icon with the suffix "_150" (150%) or "_200" (200%). See e.g. actions/laz_save_150.png

How do I do that? I can create the bigger icons with gimp and store them in the actions directory but that doesn't seem to help (tried this with the menu_run icon but it still uses the old one.

Also, in the sub-menus there is only ONE icon (for File|Save).

What am I missing?

Thanks,

Don

Ondrej Pokorny wrote 18 lines
Update: I worked further today (unfortunately...) I also added icon scaling support to the IDE. The IDE now can load 150% and 200% versions of the icons. If a High-DPI icon is missing, the normal icon is upscaled (with the worst algorithm, but that's what is available in the IDE). Request: search for volunteers who would add at least the most important IDE icons (open, save, desktops - basically what is visible in the coolbars). Please see images/README.txt for more info. Note: the High-DPI icons are used only from 144DPI (150%) upwards. 120DPI (125%) uses the original icons (which is default on Windows, AFAIK). Thanks Ondrej

Reply by email

Donald Ziesig
to Donald Ziesig
Donald Ziesig wrote 50 lines
Hi Ondrej! I downloaded the latest lazarus from svn. Then make bigide. When I started lazarus, the CoolBar is empty (except for the Save icon which is the correct size). The component icons are definitely bigger than the last version, but appear more like 125% rather than the 150% that I would expect for 144 dpi. I rebuilt the laz_images.res (at least the file time stamp changed) and the ide but there was no change in the empty CoolBar. images/README.txt says: To use a high-DPI icon, register the icon with the suffix "_150" (150%) or "_200" (200%). See e.g. actions/laz_save_150.png How do I do that? I can create the bigger icons with gimp and store them in the actions directory but that doesn't seem to help (tried this with the menu_run icon but it still uses the old one. Also, in the sub-menus there is only ONE icon (for File|Save). What am I missing? Thanks, Don On 02/21/2017 06:33 PM, Ondrej Pokorny via Lazarus wrote: > Update: I worked further today (unfortunately...) > > I also added icon scaling support to the IDE. The IDE now can load > 150% and 200% versions of the icons. If a High-DPI icon is missing, > the normal icon is upscaled (with the worst algorithm, but that's > what is available in the IDE). > > Request: search for volunteers who would add at least the most > important IDE icons (open, save, desktops - basically what is visible > in the coolbars). Please see images/README.txt for more info. > > Note: the High-DPI icons are used only from 144DPI (150%) upwards. > 120DPI (125%) uses the original icons (which is default on Windows, > AFAIK). > > Thanks > Ondrej >

Hi Ondrej!

I have a new issue this time with the "Watch List".

The contents of the form are empty! There is no menu, no expression, nothing. When I right click, I get the appropriate pop-up menu which appears to operate correctly. When I add watches, I get an empty highlight bar at the appropriate position.

After adding a few watches, it looks like this:

It worked correctly yesterday before my latest re-install for improved Hi-Res buttons.

Don
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lazarus-ide.org/pipermail/lazarus/attachments/20170222/8f5639ae/attachment.html> -------------- next part --------------
A non-text attachment was scrubbed...
Name: Screenshot at 2017-02-22 13-35-32.png
Type: image/png
Size: 6492 bytes
Desc: not available
URL: <http://lists.lazarus-ide.org/pipermail/lazarus/attachments/20170222/8f5639ae/attachment.png>

Reply by email

Ondrej Pokorny
to Donald Ziesig: Hi Ondrej! I downloaded the latest lazarus from svn. Then make bigide. When I started…
Donald Ziesig wrote 20 lines
Hi Ondrej! I downloaded the latest lazarus from svn. Then make bigide. When I started lazarus, the CoolBar is empty (except for the Save icon which is the correct size). The component icons are definitely bigger than the last version, but appear more like 125% rather than the 150% that I would expect for 144 dpi. I rebuilt the laz_images.res (at least the file time stamp changed) and the ide but there was no change in the empty CoolBar. images/README.txt says: To use a high-DPI icon, register the icon with the suffix "_150" (150%) or "_200" (200%). See e.g. actions/laz_save_150.png How do I do that? I can create the bigger icons with gimp and store them in the actions directory but that doesn't seem to help (tried this with the menu_run icon but it still uses the old one.

You have to register them in laz_images_list.txt as well and recreate res files. Please read the whole README.txt, not only the last chapter.

Also, in the sub-menus there is only ONE icon (for File|Save).

What is you OS/WidgetSet? It looks like the icons don't scale for you - you are obviously getting empty icons.

Ondrej

Reply by email

Ondrej Pokorny
to Donald Ziesig: Hi Ondrej! I have a new issue this time with the "Watch List". The contents of the form…
Donald Ziesig wrote 7 lines
After adding a few watches, it looks like this: It worked correctly yesterday before my latest re-install for improved Hi-Res buttons.

The toolbar seems to have the problem with empty icons. It's strange that you don't get any text either. Again, what OS/WidgetSet?

Ondrej
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lazarus-ide.org/pipermail/lazarus/attachments/20170224/5d8dcef8/attachment.html> -------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: image/png
Size: 6492 bytes
Desc: not available
URL: <http://lists.lazarus-ide.org/pipermail/lazarus/attachments/20170224/5d8dcef8/attachment.png>

Reply by email

Donald Ziesig
to Ondrej Pokorny: You have to register them in laz_images_list.txt as well and recreate res files. Please…
Ondrej Pokorny wrote 25 lines
On 22.02.2017 17:55, Donald Ziesig via Lazarus wrote: > Hi Ondrej! > > I downloaded the latest lazarus from svn. Then make bigide. > > When I started lazarus, the CoolBar is empty (except for the Save > icon which is the correct size). The component icons are definitely > bigger than the last version, but appear more like 125% rather than > the 150% that I would expect for 144 dpi. > > I rebuilt the laz_images.res (at least the file time stamp changed) > and the ide but there was no change in the empty CoolBar. > > images/README.txt says: > > To use a high-DPI icon, register the icon with the suffix "_150" > (150%) or "_200" (200%). See e.g. actions/laz_save_150.png > > How do I do that? I can create the bigger icons with gimp and store > them in the actions directory but that doesn't seem to help (tried > this with the menu_run icon but it still uses the old one. You have to register them in laz_images_list.txt as well and recreate res files. Please read the whole README.txt, not only the last chapter.

*I mis-understood what "register" meant. I thought there was a process that needed to be done, rather than just adding the image file name to the list. I am trying that now.*

Show quoted text 5 lines
> > Also, in the sub-menus there is only ONE icon (for File|Save). What is you OS/WidgetSet? It looks like the icons don't scale for you - you are obviously getting empty icons.

*linux mint 18 / gtk2*

Ondrej

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lazarus-ide.org/pipermail/lazarus/attachments/20170224/1f25faa2/attachment.html>

Reply by email

Vojtěch Čihák

Wouldn't be better (or would it be possible) to have *.svg icons in resources and generate *.png icons on start of IDE? Now you add 150% and 200%, later will come 250, 300% as 4k, 5k and 8k monitors come to market.  
V.

Reply by email

Donald Ziesig
to Vojtěch Čihák
Vojtěch Čihák wrote 40 lines
Wouldn't be better (or would it be possible) to have *.svg icons in resources and generate *.png icons on start of IDE? Now you add 150% and 200%, later will come 250, 300% as 4k, 5k and 8k monitors come to market. V. ______________________________________________________________ > Od: Ondrej Pokorny via Lazarus > Komu: Lazarus mailing list > Datum: 22.02.2017 00:33 > Předmět: [Lazarus] LCL High-DPI request for help adding images > Update: I worked further today (unfortunately...) I also added icon scaling support to the IDE. The IDE now can load 150% and 200% versions of the icons. If a High-DPI icon is missing, the normal icon is upscaled (with the worst algorithm, but that's what is available in the IDE). Request: search for volunteers who would add at least the most important IDE icons (open, save, desktops - basically what is visible in the coolbars). Please see images/README.txt for more info. Note: the High-DPI icons are used only from 144DPI (150%) upwards. 120DPI (125%) uses the original icons (which is default on Windows, AFAIK). Thanks Ondrej -- _______________________________________________ Lazarus mailing list http://lists.lazarus-ide.org/listinfo/lazarus

I agree. I just spent most of two days rescaling the icons with gimp, then registering them. It looks good, but I sure would not want to have to repeat for 200%, etc.

Don

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lazarus-ide.org/pipermail/lazarus/attachments/20170226/e443635f/attachment.html>

Reply by email

Vojtěch Čihák
to Vojtěch Čihák: Wouldn't be better (or would it be possible) to have *.svg icons in resources and…

I use Inkscape for icons. I use some template 64*64 px (although px means nothing in vector format, it is moreless for help-grid only). Then I use rsv-convert tool to convert icons to *.png. The icons looks best with integer multiples/divisor (i.e. 16, 32, 64, 128 px etc.). The non-integer look is also accepatble (24, 48, 96 px).  
V.
______________________________________________________________

Show quoted text 5 lines
Od: Donald Ziesig via Lazarus Komu: Datum: 26.02.2017 17:01 Předmět: Re: [Lazarus] LCL High-DPI request for help adding images

On 02/26/2017 10:33 AM, Vojtěch Čihák via Lazarus wrote:Wouldn't be better (or would it be possible) to have *.svg icons in resources and generate *.png icons on start of IDE? Now you add 150% and 200%, later will come 250, 300% as 4k, 5k and 8k monitors come to market.  
I agree.  I just spent most of two days rescaling the icons with gimp, then registering them.  It looks good, but I sure would not want to have to repeat for 200%, etc. Don

----------

Reply by email

Sven Barth
to Vojtěch Čihák

Am 26.02.2017 18:01 schrieb "Vojtěch Čihák via Lazarus" <

: I use Inkscape for icons. I use some template 64*64 px (although px means

nothing in vector format, it is moreless for help-grid only). Then I use rsv-convert tool to convert icons to *.png. The icons looks best with integer multiples/divisor (i.e. 16, 32, 64, 128 px etc.). The non-integer look is also accepatble (24, 48, 96 px).

At my company we design each icon size by hand as the non-integer devisions would definitely not be acceptable due to aliasing and also the details of the icons can more easily be adjusted to fit the icon size. So if SVG support should be added there should always be the possibility to do it the "hard" way as well if one wants to have pixel perfect icons.

Regards,
Sven
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lazarus-ide.org/pipermail/lazarus/attachments/20170226/edfc7121/attachment.html>

Reply by email

Ondrej Pokorny
to Vojtěch Čihák: Wouldn't be better (or would it be possible) to have *.svg icons in resources and…
Vojtěch Čihák wrote 6 lines
Wouldn't be better (or would it be possible) to have *.svg icons in resources and generate *.png icons on start of IDE? Now you add 150% and 200%, later will come 250, 300% as 4k, 5k and 8k monitors come to market.

You are welcome to implement such a feature. Low resolution icons (16px, 24px) have to stay in PNGs due to scaling/aliasing problems. But 4k, 5k and 8k monitor resolutions can be handled with SVG icons.

I tested AggPas with some SVG icons and the results were not good. Icons that I tried couldn't be am not sure fpvectorial is better. So first we need a good renderer and then we need a bunch of icons. Any help is appreciated. I won't do that.

Ondrej
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lazarus-ide.org/pipermail/lazarus/attachments/20170226/e6fd638f/attachment.html>

Reply by email

Kostas Michalopoulos
to Ondrej Pokorny

SVN is not ideal for icon formats. Beyond being too big (it is a verbose XML file after all), vector icons do not good at arbitrary sizes. IMO the best approach for vector icons is what Haiku OS is doing by using a custom icon format that is designed for small sizes and -more importantly- different elements in an icon can have a LOD range so that some elements will be hidden in small sizes and others hidden in large sizes.

Details and an example for LOD is here:

https://www.haiku-os.org/docs/userguide/en/applications/icon-o-matic.html

The icon with the four colored triangles only show numbers in large sizes and in small sizes the outline is replaced with a thicker one that is still visible despite the small size (the original outline would be a smudge at the smallest size).

More technical details for Haiku's format can be found here:

http://blog.leahhanson.us/post/recursecenter2016/haiku_icons.html

Of course this is probably the hardest approach to take (at minimum one would need to make an editor for such icons), but IMO if a DPI-agnostic is to be made, it is better to go with the technically superior approach if such a solution is to remain around for years.

(note that i do not think that using the haiku format directly is a good idea by itself, i'm just giving it as an example)

AFAIK SVG itself does not support LODs, although it is possible to emulate it if the SVG loader supports CSS and media queries so one could use something like @media screen and (max-width: 32px) for selecting 32px and below sizes. With multiple of these one can adjust properties like stroke widths and hide elements. But i'm not sure if any non-browser SVG loader even support CSS, let alone CSS with media queries.

Regardless if there is support for that, information can be found here for LOD:

http://w3c.github.io/svgwg/specs/svg-authoring/

(search for 2.6. Responsive Images)

FWIW personally i think a dedicated format for vector icons (like what Haiku uses) would be a better idea in the long term.

On Sun, Feb 26, 2017 at 11:13 PM, Ondrej Pokorny via Lazarus <

Show quoted text 20 lines
wrote: On 26.02.2017 17:01, Donald Ziesig via Lazarus wrote: > I agree. I just spent most of two days rescaling the icons with gimp, > then registering them. It looks good, but I sure would not want to have to > repeat for 200%, etc. > Do you mean that you took Lazarus original 16px icons, scaled them up to 24px one by one and registered them for Lazarus? Ondrej -- _______________________________________________ Lazarus mailing list http://lists.lazarus-ide.org/listinfo/lazarus

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lazarus-ide.org/pipermail/lazarus/attachments/20170227/b56c7efe/attachment.html>

Reply by email

Graeme Geldenhuys
to Kostas Michalopoulos
Kostas Michalopoulos wrote
IMO the best approach for vector icons is what Haiku OS is doing by using a custom icon format that is designed for small sizes and -more importantly- different elements in an icon can have a LOD range

Indeed, Haiku came up with a very clever system that seems to work really well.

Regards,
Graeme

Reply by email

Marc Weustink
to Ondrej Pokorny: You are welcome to implement such a feature. Low resolution icons (16px, 24px) have to…
Ondrej Pokorny wrote 20 lines
On 26.02.2017 16:33, Vojtěch Čihák via Lazarus wrote: > > Wouldn't be better (or would it be possible) to have *.svg icons in > resources and generate *.png icons on start of IDE? Now you add 150% > and 200%, later will come 250, 300% as 4k, 5k and 8k monitors come to > market. > You are welcome to implement such a feature. Low resolution icons (16px, 24px) have to stay in PNGs due to scaling/aliasing problems. But 4k, 5k and 8k monitor resolutions can be handled with SVG icons. I tested AggPas with some SVG icons and the results were not good. Icons that I tried couldn't be am not sure fpvectorial is better. So first we need a good renderer and then we need a bunch of icons. Any help is appreciated. I won't do that.

That was also my experience. At work we use svg images and I wrote my own (limited) the svg parser and render the images with aggpas. For us this parser is OK, but it lacks a lot of svg features

Marc

Reply by email

Donald Ziesig
to Ondrej Pokorny: Do you mean that you took Lazarus original 16px icons, scaled them up to 24px one by one…
Ondrej Pokorny wrote 9 lines
On 26.02.2017 17:01, Donald Ziesig via Lazarus wrote: > I agree. I just spent most of two days rescaling the icons with > gimp, then registering them. It looks good, but I sure would not > want to have to repeat for 200%, etc. Do you mean that you took Lazarus original 16px icons, scaled them up to 24px one by one and registered them for Lazarus? Ondrej

Precisely! :-D

I tried to use Script-fu on Gimp, but I thought it would take me longer the learn it than doing the conversion manually.

Don

Reply by email