Author Topic: Slickedit gray-scales my bitmaps  (Read 4537 times)

Graeme

  • Senior Community Member
  • Posts: 2796
  • Hero Points: 347
Slickedit gray-scales my bitmaps
« on: March 17, 2018, 03:06:46 AM »
As complained of here
https://community.slickedit.com/index.php/topic,15559.0.html
I have some tool-windows which I load bitmaps for.  When these bitmaps are loaded, SlickEdit applies gray-scaling to the bitmaps when I didn't ask it to.  It seems that slick does this to make its own buttons suit the new (and in my opinion ugly) monochrome and two tone colour schemes.  For 22.0.0 I found a workaround which involved unloading my macros, swapping the colour scheme then reloading my macros.  Somehow this stopped slick from applying gray scaling to my icons, long enough for me to load them.  Then I swapped the colour scheme back to "colour".  I can't get this to work with 22.0.2 nor can I remember exactly how I did it last time.  In my opinion this is a bug.  If I wanted less vibrant icons I would load less vibrant icons.  No upgrading for me until there's a solution for this.


Dennis

  • Senior Community Member
  • Posts: 3966
  • Hero Points: 517
Re: Slickedit gray-scales my bitmaps
« Reply #1 on: March 19, 2018, 02:17:44 PM »
Could you send your bitmaps and macros into support.  I will try it out and find out what is going on.  Are your icons .svg, .ico, .png, or .bmp ?

What color scheme are you using?  (Tools > Options > Appearance > Tool Window and Toolbar Options > Tool Buttons and Icons > Style.  The only style that applies a monochrome filter is, in fact, "Monochrome".

rgloden

  • Senior Community Member
  • Posts: 169
  • Hero Points: 5
Re: Slickedit gray-scales my bitmaps
« Reply #2 on: March 21, 2018, 04:37:18 AM »
Not to pile on ... but I am also disappointed in the new icons ...

Definitely does not "Wow" new users that I demo SlickEdit too ...

Graeme

  • Senior Community Member
  • Posts: 2796
  • Hero Points: 347
Re: Slickedit gray-scales my bitmaps
« Reply #3 on: March 21, 2018, 10:14:58 AM »
Could you send your bitmaps and macros into support.  I will try it out and find out what is going on.  Are your icons .svg, .ico, .png, or .bmp ?

What color scheme are you using?  (Tools > Options > Appearance > Tool Window and Toolbar Options > Tool Buttons and Icons > Style.  The only style that applies a monochrome filter is, in fact, "Monochrome".

It will be the weekend before I can get my macros and bitmaps together for you.  In the meantime, you can reproduce the effect that I think is messing up my bitmaps as follows.  The attached bitmap shows before gray scaling (darkening) on the left and after on the right.  You can see the one on the right has been darkened.  I ran slick V22.0.2 on a new empty config folder.  Cancel out of quick start.  Go into options and change style "default low colour" to "colour". Exit options.  Now go and add a new icon to the toolbar at the top - then change the icon to _bh_workspace.ico from slick V20.0.3 bitmaps folder.  When the new bitmap appears on the toolbar it is darker than the original _bh_workspace.ico as shown in "Paint".  I'm guessing (don't know for sure) that this is what is messing up my own icons which are currently png  - it makes no difference if I use bitmaps though.  The effect on the two toolbars I have is a mass of little gray squares that shouldn't be there  - as shown in this post
https://community.slickedit.com/index.php/topic,15559.msg59255.html#msg59255

Also you'll notice that I said the problem was gone in RC2
https://community.slickedit.com/index.php/topic,15559.msg59806.html#msg59806
but I think it was back in the final V22 release and I managed to overcome it by un-loading my loaded bitmaps (don't remember how I did that - probably by wiping my config) then fiddling with the color style setting somehow and reloading my bitmaps.

Dennis

  • Senior Community Member
  • Posts: 3966
  • Hero Points: 517
Re: Slickedit gray-scales my bitmaps
« Reply #4 on: March 22, 2018, 02:48:11 PM »
ok, so not grayscale at all, just kid of grayed.  Are you using the Dark theme or the System theme?  There is code to adjust bitmap palettes when the image is loaded to compensate for darker and lighter backgrounds.  This is necessary because the same bitmap might look great on a dark background and terrible on a light background.  If you try to "leave it alone" you will ultimately have bitmaps that don't really "pop" in either case.  You can force this code when loading a color bitmap by append "@d" (dark background, image will be brightened) or "@l" (light background, image will be darkened) to the end of the file name "_bh_workspace.ico@d", for example.

Knowing that some people might want more muted colors, and others more vibrant colors, there is an advanced setting we put together a setting to bias the colors when images are loaded, however, it only applies to our bitmaps, not user-loaded bitmaps.  The setting is (Macro > Set Macro Variable... > def_toolbar_pic_hsv_bias).  Here are the docs on this setting:
Code: [Select]
// Hue, Saturation, and Brightness bias.
// Use this to calibrate button bar and tool window icon loading to
// your tastes with respect to color saturation and brightness.
//
// This is a triplet of "h s v", wher:
//    h -- is the hue adjustment, the number of degrees to rotate on the
//         HSV color wheel (ranging between -359 ... 359)
//    s -- saturation adjustment (ranging between -255 ... 255)
//    v -- brightness value adjustment (ranging between -255 ... 255)
//
_str def_toolbar_pic_hsv_bias="";

I was using it with the setting "-2 30 40" to make the color bitmaps pop a bit more on my old monitor.

For what it's worth, the bitmap you gave as an example looks a lot like _f_workspace.svg and bbworkspace.svg.  You might want to just use those instead for consistency.  I realize you have other bitmaps though, which I do not know if you are using on toolbars or in tree controls or in some other way.

Graeme

  • Senior Community Member
  • Posts: 2796
  • Hero Points: 347
Re: Slickedit gray-scales my bitmaps
« Reply #5 on: March 23, 2018, 08:26:28 AM »
I didn't really know what gray-scale meant, I just picked a word that sounded right, especially as slick is turning white into gray.

I'm using the system theme.  The icon that I posted was just for illustrating the problem, I'm not actually using it.  Do you have any idea how I can fix this?  Is there an @ option for neither brightening or darkening.  In both cases I'm using listboxes and I assign the picture using _lbadd_item.

Dennis

  • Senior Community Member
  • Posts: 3966
  • Hero Points: 517
Re: Slickedit gray-scales my bitmaps
« Reply #6 on: March 23, 2018, 03:05:15 PM »
Try user a modifier of "@<n>" where 'n' is the size of the image you want to load.  For example, "_bh_workspace.ico@" :+ _toolbar_pic_size_as_integer().

For v23, I'm going to add a @native style modifier, to make it simpler to prevent the icon from begin adjusted for the background color.

Graeme

  • Senior Community Member
  • Posts: 2796
  • Hero Points: 347
Re: Slickedit gray-scales my bitmaps
« Reply #7 on: March 24, 2018, 07:09:19 AM »
I've found a way round the problem.  If I delete the content of my 22.0.2 config folder, then run slickedit (and cancel out of the fast config thing), it initializes the configuration without migrating my 22.0.0 config.  The default style setting then appears as low colour.  If I then load my macros, including list-boxes and bitmaps, I don't get the problem of darkened icons and squares of gray everywhere.  Then I import my settings from 22.0.0 and everything's ok  - except for one thing.  The style setting is left at low colour when my 22.0.0 settings had "colour" as the setting.  I think the help says that exporting and importing settings between versions like this is unsupported so I'll see how it goes.

Thanks for looking in to it.

Graeme

  • Senior Community Member
  • Posts: 2796
  • Hero Points: 347
Re: Slickedit gray-scales my bitmaps
« Reply #8 on: March 27, 2018, 11:36:28 AM »
Also if I set my colour style to low colour before I migrate my config from 22.0.0 to 22.0.2, my bitmaps show up as I want them to, without any darkening.  So presumably, any time I want to load bitmaps, I can set the style temporarily to low colour first, then switch it back afterwards.

Graeme

  • Senior Community Member
  • Posts: 2796
  • Hero Points: 347
Re: Slickedit gray-scales my bitmaps
« Reply #9 on: September 25, 2018, 02:21:37 AM »
Try user a modifier of "@<n>" where 'n' is the size of the image you want to load.  For example, "_bh_workspace.ico@" :+ _toolbar_pic_size_as_integer().

For v23, I'm going to add a @native style modifier, to make it simpler to prevent the icon from begin adjusted for the background color.

Hi
Is there a modifier in V23 that prevents the icon colour from being adjusted?  I don't see any allowance for modifiers in _find_or_add_picture or _update_picture.


Dennis

  • Senior Community Member
  • Posts: 3966
  • Hero Points: 517
Re: Slickedit gray-scales my bitmaps
« Reply #10 on: September 25, 2018, 02:47:38 PM »
Did you try @native<n> ?

Graeme

  • Senior Community Member
  • Posts: 2796
  • Hero Points: 347
Re: Slickedit gray-scales my bitmaps
« Reply #11 on: September 25, 2018, 11:35:22 PM »
No I didn't.  My bitmaps aren't toolbar buttons and I'd prefer not to have to figure out the size but I'll give it a go.

Dennis

  • Senior Community Member
  • Posts: 3966
  • Hero Points: 517
Re: Slickedit gray-scales my bitmaps
« Reply #12 on: September 26, 2018, 01:20:23 AM »
The size is optional, so you can just use @native