Recent

Author Topic: [SOLVED] What is wrong with my LRS?  (Read 864 times)

CM630

  • Hero Member
  • *****
  • Posts: 1137
  • Не съм сигурен, че те разбирам.
    • http://sourceforge.net/u/cm630/profile/
[SOLVED] What is wrong with my LRS?
« on: May 30, 2024, 10:23:28 am »
I have created a 24x24 LRS from a 24x24 PNG.
The LRS looks fine in LRS Explorer 1.0.0.1.
But when I add it to my package, it looks tragically in the IDE.
The LRS is attached, but I have changed its name to .TXT, because I am not allowed to upload it as a LRS.

So maybe someone could tell me if there is something wrong with my LRS and is it fixable?
« Last Edit: May 31, 2024, 09:02:51 am by CM630 »
Лазар 3,4 32 bit (sometimes 64 bit); FPC3,2,2

VisualLab

  • Sr. Member
  • ****
  • Posts: 361
Re: What is wrong with my LRS?
« Reply #1 on: May 30, 2024, 11:07:07 am »
As far as I remember, the problem is probably related to the fact that the color of the lower left pixel of the icon is used as the so-called transparent colour. Hence, there is no black element. Furthermore, after opening the attached PNG file in a raster graphics editor (Paint), I noticed that not all "black" pixels are actually black.

wp

  • Hero Member
  • *****
  • Posts: 12069
Re: What is wrong with my LRS?
« Reply #2 on: May 30, 2024, 11:54:42 am »
Is this for a palette icon? Either save the original image as alpha-transparent png (32 bits per pixel) which avoids the concept with the "transparent color" because the image has an independent transparency channel (alpha), or edit the four corner pixels and change them to some color which is not found anywhere in the image. This way, only the four corner pixels will become transparent.

CM630

  • Hero Member
  • *****
  • Posts: 1137
  • Не съм сигурен, че те разбирам.
    • http://sourceforge.net/u/cm630/profile/
Re: What is wrong with my LRS?
« Reply #3 on: May 30, 2024, 12:21:38 pm »
Is this for a palette icon? Either save the original image as alpha-transparent png (32 bits per pixel) which avoids the concept with the "transparent color" because the image has an independent transparency channel (alpha), or edit the four corner pixels and change them to some color which is not found anywhere in the image. This way, only the four corner pixels will become transparent.
Yes, it is a pallete icon.
For saving the file as 32 per pixel, I guess I will have to use some heavy artillery (LazPaint does not have 32 bits saving, maybe I shall use Gimp or I do not know what).
I made the top-left pixel gray, now it looks fine.
Лазар 3,4 32 bit (sometimes 64 bit); FPC3,2,2

wp

  • Hero Member
  • *****
  • Posts: 12069
Re: What is wrong with my LRS?
« Reply #4 on: May 30, 2024, 12:50:28 pm »
LazPaint does not have 32 bits saving
Being a BGRABitmap application, I am pretty sure that it has, but probably not for expanding the color depth of an image.

A suggestion from Roland Hahn, the author of most of the icons used by Lazarus now: Draw icons with a vector graphics application such as Inkscape (not sure, maybe LazPaint can do this now, too), save the raw image as svg and then export png images in all the sizes needed. Because high-dpi support requires you to provide images at several sizes, and with a pixel-based program you'd have to do the drawing all over again.

CM630

  • Hero Member
  • *****
  • Posts: 1137
  • Не съм сигурен, че те разбирам.
    • http://sourceforge.net/u/cm630/profile/
Re: What is wrong with my LRS?
« Reply #5 on: May 31, 2024, 09:02:36 am »
SVG makes a perfect sense, but InkScape sounds too scary for me.
Working with Lazarus Image Editor occured to be a real pain to - it has no undo/redo and no copy/paste.

I have added some info in the wiki: https://wiki.freepascal.org/How_To_Write_Lazarus_Component#Step_3%3A_Create_icons_for_the_package
« Last Edit: May 31, 2024, 11:24:38 am by CM630 »
Лазар 3,4 32 bit (sometimes 64 bit); FPC3,2,2

 

TinyPortal © 2005-2018