Png icon data

damir · 810

damir

  • Newbie
  • *
    • Posts: 33
    • Karma: +10/-3
    • ioox.studio
on: August 14, 2022, 02:38:40 AM
Hi,

If I cat in bash two png files I get dual icon that works fine under Aros.
Is there any unix util that I could use to inject other icon data after cat?



AMIGASYSTEM

  • Global Moderator
  • Legendary Member
  • *****
    • Posts: 3740
    • Karma: +69/-2
  • AROS One
    • AROS One
Reply #1 on: August 14, 2022, 03:39:05 AM
Hi damir, about the Icons, yes just merge two PNG images, but let's say this is a simple tool where you can't add other things like frame effects etc..

On AROS One but also on IcarOS there are more good tools to create icons, the first one is "IconPoser", simple program to merge images, the second one strongly recommended is "IconEditor" where besides merging images you can add many effects, Glow and many other important tools.

I am responding here to your PM:

Regarding your PM request, help is always welcome, as said my AROS One is everyone's, whatever you do will be placed on AROS One, thank you for your cooperation.


damir

  • Newbie
  • *
    • Posts: 33
    • Karma: +10/-3
    • ioox.studio
Reply #2 on: August 14, 2022, 03:58:49 AM
SVG is not an option on Aros?

BTW can you pm you email?



Mazze

  • Junior Member
  • **
    • Posts: 88
    • Karma: +36/-0
Reply #3 on: August 14, 2022, 04:13:14 AM
AROS build system uses this to create icons with injected icon data
https://github.com/aros-development-team/AROS/tree/master/tools/ilbmtoicon
Despite the name it works with PNG, too.



damir

  • Newbie
  • *
    • Posts: 33
    • Karma: +10/-3
    • ioox.studio
Reply #4 on: August 14, 2022, 04:21:32 AM
@Mazze
Hi, I think that's what I need.

I have a bash script (ImageMagick) that takes SVG converts it into PNG and adds shadow or glow (for selected).
But I need to inject other data somehow.




magorium

  • Legendary Member
  • *****
    • Posts: 632
    • Karma: +62/-0
  • Convicted non contributor
Reply #5 on: August 14, 2022, 07:49:23 AM
But I need to inject other data somehow.
Can you share what data you wish to inject ? (sounds a bit shady  ::) )

If you want to change some of the settings of the icon then processicon comes to mind.

But it depends on what you want to inject... if processicon does not have a proficiency for what you want to inject then processicon wouldn't be helpful either.

@AmigaSystem:
Damir probably just wants to use the shell for processing a large number of icons. In that case manually editing icons (by otherwise perfectly capable icon-tools) is not really an option.


AMIGASYSTEM

  • Global Moderator
  • Legendary Member
  • *****
    • Posts: 3740
    • Karma: +69/-2
  • AROS One
    • AROS One
Reply #6 on: August 14, 2022, 08:33:19 AM

@AmigaSystem:
Damir probably just wants to use the shell for processing a large number of icons. In that case manually editing icons (by otherwise perfectly capable icon-tools) is not really an option.

Yes I had guessed, the term "inject" made me think of something else.

A script to edit a set of icons would be very useful, in my icon edits a script won't do because with each icon I add or delete something to improve appearance and quality, plus size the various types of effects, that change from icon to icon, all things you can only do and faster with an IconEditor, among other things it is Multiplatform.



damir

  • Newbie
  • *
    • Posts: 33
    • Karma: +10/-3
    • ioox.studio
Reply #7 on: August 14, 2022, 10:00:06 AM
 :) Yes maybe "inject" is not best word but you get the point, I want to
have build script that will generate icons from SVG files.

I don't know if anyone is interested but this is the script so far...

Code: [Select]
#!/bin/bash
. ./config.conf

WORK_DIR=$(pwd) ;
BUILD_DIR=$WORK_DIR"/"$outputDirName ;


for f in ./src/*; do
  if [ -d "$f" ]; then
BASENAME=$(basename $f) ;
FILE0= $f"/0.svg" ;
FILE1= $f"/1.svg" ;
       
         convert -resize $resizeTo -channel rgba -background "rgba(0,0,0,0)" $f"/0.svg" $f"/0.png" ;
         
         if test -f "$FILE1"; then
           convert -resize $resizeTo -channel rgba -background "rgba(0,0,0,0)" $f"/1.svg" $f"/1.png" ;                 
         fi
                 
if [ "$shadow" == "true" ]; then    
   convert $f"/0.png" -gravity 'northwest' -background 'rgba(255,255,255,0)'  \( +clone -background '#005f005f005f0000' -shadow "80x3-1-1" \) +swap -background none -mosaic +repage $f"/build_0.png" ;
   if [ "$selectedGlow" != "true" ]; then
     if test -f "$FILE1"; then
       convert $f"/1.png" -gravity 'northwest' -background 'rgba(255,255,255,0)'  \( +clone -background '#005f005f005f0000' -shadow "80x3-1-1" \) +swap -background none -mosaic +repage $f"/build_1.png" ;
     else
   convert $f"/0.png" -gravity 'northwest' -background 'rgba(255,255,255,0)'  \( +clone -background '#005f005f005f0000' -shadow "80x3-1-1" \) +swap -background none -mosaic +repage $f"/build_1.png" ;
     fi
   fi
fi          

         if [ "$selectedGlow" == "true" ]; then    
            if test -f "$FILE1"; then
  convert $f"/1.png" -gravity 'northwest' -background Yellow  \( +clone -background Yellow -shadow "80x3-1-1" \) +swap -background none -mosaic +repage $f"/build_1.png" ;
            fi
fi       
         
                 
         cat $f"/build_0.png" $f"/build_1.png" > $f"/ok.png"     
  fi
done

Add attached result:



magorium

  • Legendary Member
  • *****
    • Posts: 632
    • Karma: +62/-0
  • Convicted non contributor
Reply #8 on: August 14, 2022, 11:51:43 AM
:) Yes maybe "inject" is not best word but you get the point, I want to have build script that will generate icons from SVG files.
I was able to grasp that, yes  :)

My point being that I/we can't help any further unless knowing what it is what you would like to add to what you already got ;)

In principle having 2 png pictures 'glued' together is enough for AROS to treat/detect it as an icon. Any further details can be added with the WorkBench icon details menu (for example in case you wish to make it a project icon). Additional (required) data will be added to the original file automatically once you save the icon (it then becomes a true Amiga/AROS icon).