Any tool for 24x24 image conversion to Hex icon code?

Hi,
I would like to create a nice macro toolset with beautiful large icons for Action tools.
I know the trick to call an up to 26x26 px png file in the toolsets/icons directory, but this way is harder to share than a single .ijm file.
The “image_to_icon” macro is awesome but the limit of 16x16px is frustrating! If it could go to 24x24 it would be great!
Any idea?

Thanks,
Kevin

There are icon drawing instructions for defining positive or negative offsets relative to the base drawing location. See here: Macro Language
So the upper left image region could be drawn after a N66 negative offset, then move the drawing location to Bf0 and draw the upper right region, then B0f and draw the lower right region, then Nf0 and draw the lower left region.

I did this. The code is available here: Convert 26x26 Image to Tool Icon · GitHub

image

2 Likes

Haha what can I say… Thank you so much! I spent the last hour trying to understand your first answer
because the Hex code is really hard to get for beginners like me. But just when I was getting to think “i’m sure the original convertion could be adapted, in the next month I might be able to do it if I work hard…”, I see you adapted and shared it in like 20 min!
Thanks again, big fan.

1 Like

@Wayne reminded me that icon drawing can use extended hex code (0…f,g…n) so we could have built-in support for 24px icons without any further trick. I will update the code to make use of this.
Jerome.

1 Like

Well I’m really happy with the 26x26 version! and with the new Icon animation possibility,
Imagej will become so more fun :wink:
Capture d’écran 2021-01-17 à 22.01.01

1 Like

For the record, Alan Brooks created a 24px version of the Image to Tool Icon macro available here:

2 Likes

I updated the gist to support RBG images directly and to center icons < 16x16 too.

2 Likes