Problems with image files used on panel

ron.alan

Active Member
Joined
Dec 24, 2023
Messages
249
Reaction score
188
Credits
1,708
This is a weird issue. I want to make an image file using Gimp to be used as a panel icon. After I set the created image file as a panel icon and hover the cursor over the icon, the right side of the icon goes black. See screenshot (it's just a green "R" on a blue background). I tried .jpg, .pgm, and .png, and they all produce this black shadow when hovered over. The only file type where I don't get this black shadow is, of all things, the Microsoft icon file type, .ico. I guess it doesn't matter, I'll use it since I have too. But does anybody know why the shadow happens on the other file types?


problem.icon.jpg
 


Knowing your DE may help.
 
It might have to do with image size in pixels.
Probably the image is too big and the compositor (or what ever is responsible to render it) is rendering only supported area of the image.
 
It looks like MATE.
Yes it is. Any other info needed? The OS is Devuan.

Probably the image is too big . . .
I doubt it. I saved all the different file types as 24 x 24.

. . . and the compositor (or what ever is responsible to render it) is rendering only supported area of the image.
It only happens when I hover the cursor over it. It looks fine otherwise (no shadow with no hovering over).
 
Last edited:
One of the nice things about Puppy's ROX-filer/JWM 'desktop' combo is that you can deal with what I call 'normal'-sized icons (128x128, 256x256, even 512x512). These are far simpler to work with.....but JWM has a neat trick up its sleeve.

It doesn't matter what format you use - many prefer SVG images, because these will 're-size' to suit the constraints of their surroundings without losing detail - but JWM is equally happy with PNG images, which is MY preferred format. If used on the 'desktop' (ROX's 'pinboard'), JWM automatically resizes all icons to 48x48.......whereas if used in the tray, that auto-resize operation shrinks 'em down to 24x24 (or 16x16 if, like me, you prefer a 'low-profile' tray without much height to it).

All of which makes this kind of stuff so much simpler.....and easier to achieve the desired result.

@ron.alan :-

I think CaffeineAddict's supposition may be wrong, but I suspect he's on the right track. My guess is that it's almost certainly something to do with the window compositor.

We've only been using these things in Puppy for perhaps the last 4-5 years, but we've already discovered that many oddities can be solved simply by turning the thing off.


Mike. ;)
 
Last edited:
I think CaffeineAddict's supposition may be wrong, but I suspect he's on the right track. My guess is that it's almost certainly something to do with the window compositor.
I suppose that's possible, but why don't the icons supplied by the apps or the themes have this shadow then? If it was the compositor wouldn't it happen on all icons?
 
OP: Could you upload you icon? Preferably the original GIMP file, not an export? I promise nobody will steal it and copyright it, lol.
There are considerations...
  • like resolution: it may be scaled to size^2, but may not actually be size^2 so there's alpha when exporting.
  • like alpha you're not seeing.
I mention this because some panels' highlighting is rendered as a block with the icon rendered on top. If the image is only opaque until a certain length, then there's alpha, the highlight may shine "through".
  • like export settings
The metadata in a jpeg for example can state the resolution even if the image is not that resolution.

... You get the idea. Best to examine the source.
 
Well I don't have the original image, which was just a screenshot of an "R" in AbiWord, but I do have one of the files that gives me a shadow.

Untitled.png
 
Okay, that's pretty small as an original size. It could be that there's dither around the edges of the R and your DE/panel renderer does not support a wide enough palette or that there's a slight variance along there edge... Anyway, try one of the reworked two, otherwise, just test the third so we can narrow it down.
Removed all meta info, explicit 8-bit RGB:
V2.png

Adjusted Margins:
V3.png

Test ver:
V4.png
 
Still get black shadow when hovering. Tested the bottom image (V4.png). I like the green border you put around it.
 
You may also try just deleting the launcher and re-adding using a different icon, too. Failing that...

I looked into Mate, it has its own compositor. I had rendering issues with XFCE4 as of 4.18 (although it was conky, not any XFCE4 software). I resolved it by playing around with different compositors. Picom is by far the simplest as it comes with a config file OTB. According to notes, it looks like the procedure for Mate is pretty much the same as XFCE4:

# apt-get install picom
Example is included, copy it:
$ mkdir $HOME/.config/picom/
$ cp /usr/share/doc/picom/examples/picom.sample.conf $HOME/.config/picom/picom.conf
Everything you need to know (including upstream git):

Now:
1. Go to settings and "Window Manager Tweaks".
2. Disable Compositor.
3. Does this change anything? If yes, we're on the right track. If no, it's still worth a try to...
4. Run in terminal: picom
If you placed the config file in another location, use --config /path/to/where/it/is.conf
5. If this works, well you have an option, and you can setup it up in xinitrc. If not, Picom closes when you hit Ctrl + C and you can easily uninstall it and re-enable your compositor.


I like the green border you put around it.
I just that to test if the black glitch was related to colour values, lol. But if you're wanting to do something fancy, here's an SVG template. You can change the font, colours, etc. in Inkscape to your liking (I can't attach it, so copy the code in the spoiler to a plaintext editor and save as a .svg file):
Code:
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!-- Created with Inkscape (http://www.inkscape.org/) -->

<svg
   width="120"
   height="120"
   viewBox="0 0 120 120"
   version="1.1"
   id="svg5"
   inkscape:export-filename="bitmap.png"
   inkscape:export-xdpi="96"
   inkscape:export-ydpi="96"
   inkscape:version="1.2.2 (b0a8486541, 2022-12-01)"
   sodipodi:docname="Icon.svg"
   xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
   xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
   xmlns="http://www.w3.org/2000/svg"
   xmlns:svg="http://www.w3.org/2000/svg">
  <sodipodi:namedview
     id="namedview7"
     pagecolor="#ffffff"
     bordercolor="#000000"
     borderopacity="0.25"
     inkscape:showpageshadow="2"
     inkscape:pageopacity="0.0"
     inkscape:pagecheckerboard="0"
     inkscape:deskcolor="#d1d1d1"
     inkscape:document-units="px"
     showgrid="false"
     inkscape:zoom="0.44427083"
     inkscape:cx="302.74326"
     inkscape:cy="187.94842"
     inkscape:window-width="1910"
     inkscape:window-height="1022"
     inkscape:window-x="0"
     inkscape:window-y="24"
     inkscape:window-maximized="1"
     inkscape:current-layer="layer1" />
  <defs
     id="defs2" />
  <g
     inkscape:label="Layer 1"
     inkscape:groupmode="layer"
     id="layer1">
    <text
       xml:space="preserve"
       style="fill:#000000;-inkscape-font-specification:'Gentium Book Basic';font-family:'Gentium Book Basic';font-weight:normal;font-style:normal;font-stretch:normal;font-variant:normal;stroke:#217737;stroke-opacity:1"
       x="17.597221"
       y="14.270386"
       id="text167"><tspan
         sodipodi:role="line"
         id="tspan165"
         x="17.597221"
         y="14.270386" /></text>
    <g
       id="g5826"
       transform="matrix(2.1318386,0,0,2.1318386,-55.948762,-25.818795)"
       style="fill:#dd4814">
      <circle
         style="fill:#0088e8;stroke:#0080e8;stroke-width:5.248;stroke-dasharray:none;stroke-opacity:1"
         id="path5717"
         cx="54.547089"
         cy="40.482944"
         r="24.407194" />
      <text
         xml:space="preserve"
         style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:62.9783px;font-family:'Gentium Book Basic';-inkscape-font-specification:'Gentium Book Basic';fill:#ffffff;stroke:none;stroke-width:5.248;stroke-dasharray:none;stroke-opacity:1"
         x="37.623646"
         y="59.337734"
         id="text171"><tspan
           sodipodi:role="line"
           id="tspan169"
           x="37.623646"
           y="59.337734"
           style="fill:#ffffff;stroke:none;stroke-width:5.248;stroke-dasharray:none;stroke-opacity:1">R</tspan></text>
    </g>
  </g>
</svg>
 
Unchecking "Enable software compositing window manager" didn't fix the issue. That's as far as I'm going to go messing around with window compositors.
 
I also find the GIMP is useful in other ways related to this issue.

Occasionally, I'll download an icon from online, only to find that it won't display anywhere. No image-editor will show it.

Run such files through the GIMP. Open them, and the GIMP will usually ask if you want to convert the associated 'colour-profile'. I just accept the default sRGB profile, then re-save it again as the same filename, effectively overwriting it. 99% of the time, this will almost always 'fix' them.

Just a wee tip for y'all.


Mike. ;)
 
Last edited:

Members online


Top