English Amiga Board


Go Back   English Amiga Board > Support > support.Apps

 
 
Thread Tools
Old 26 March 2011, 02:07   #21
mfilos
Paranoid Amigoid
 
mfilos's Avatar
 
Join Date: Mar 2008
Location: Athens/Greece
Age: 45
Posts: 1,978
Warp datatypes rule! Awesome product to register and support is really nice!

Thanks PeterK for your updates! \o/
mfilos is offline  
Old 26 March 2011, 05:45   #22
PeterK
Registered User
 
Join Date: Apr 2005
Location: digital hell, Germany, after 1984, but worse
Posts: 3,365
Ok, here comes already a new version. This time I could find a workaround for the akPNG.datatype too. So, both WarpPNG and akPNG should ignore the AlphaChannel in the preferences now. Of course, work is still in process and some improvements here or there may follow in the next days. But it can be difficult to display the second image (the selected icon state) and it's already relative slow. At least, it looks much better than these old and ugly deficons, or not?? Let's see what's possible and please report any problems.

Update below ...

Last edited by PeterK; 28 March 2011 at 13:31.
PeterK is offline  
Old 26 March 2011, 07:49   #23
gulliver
BoingBagged
 
gulliver's Avatar
 
Join Date: Aug 2007
Location: The South of nowhere
Age: 46
Posts: 2,358
Thanks again PeterK

This was the feature I was most expecting. It is truly great

BTW, in this test snapshot I used http://aminet.net/util/dtype/PNGdt44.lha to have png datatype support (AGA 256 colors).
Attached Thumbnails
Click image for larger version

Name:	021.png
Views:	359
Size:	49.2 KB
ID:	28198  
gulliver is offline  
Old 26 March 2011, 08:37   #24
Cosmos
Banned
 
Join Date: Jan 2007
Location: France
Posts: 655
Fantastic & Fantastique !
Cosmos is offline  
Old 26 March 2011, 10:44   #25
James
Registered User
 
Join Date: Mar 2010
Location: Beckenham/England
Posts: 795
Don't know if this is any use to this project but Fredrik Wikstrom created a png.image class to allow transparent png icons in toolbars.

http://www.a500.org/downloads/librar...age_zip.readme

@Minuous - This may also be of interest to you for AmiArcadia + ReportPlus..?
James is offline  
Old 26 March 2011, 13:30   #26
Minuous
Coder/webmaster/gamer
 
Minuous's Avatar
 
Join Date: Oct 2001
Location: Canberra/Australia
Posts: 2,630
@James:

I'm happy to consider this, but I'm not sure what benefits you are expecting if I did implement this...? You are not happy with the current toolbar and want transparent PNG toolbar icons!? I would still have to pick a default background colour so I don't think the effect would be really different...

PNG.datatype which is already in BB4 should presumably handle AISS without me needing to convert AISS imagery to IFF ILBM, although I have only tested representative files rather than the entire AISS imagery set.

@mfilos:

>Warp datatypes rule! Awesome product to register and support is really nice!

Unfortunately nagware such as this cannot be included in BB4 because of the massive annoyance to users. Except conceivably in conjunction with a nagware-requester-removal patch. We do not intend that users should be forced or nagged into registering BB4 or any component thereof.
Minuous is offline  
Old 26 March 2011, 15:33   #27
James
Registered User
 
Join Date: Mar 2010
Location: Beckenham/England
Posts: 795
Quote:
Originally Posted by Minuous View Post
@James
I'm happy to consider this, but I'm not sure what benefits you are expecting if I did implement this...? You are not happy with the current toolbar and want transparent PNG toolbar icons!? I would still have to pick a default background colour so I don't think the effect would be really different...
No, the black background is fine, the only problem was when I tried to save disk space and remove your AISS images (I already have AISS installed for DiskImageGUI). Then I get a horrible pink background, but DiskImageGUI gives me a grey background with the same images. So I assume it would allow you to set your background without altering the background in each image? Anyway, this is not a big deal, keeping your AISS images is no problem. Sorry if I've wasted your time with this.
James is offline  
Old 28 March 2011, 13:21   #28
PeterK
Registered User
 
Join Date: Apr 2005
Location: digital hell, Germany, after 1984, but worse
Posts: 3,365
In icon.library 46.4.195 the PNG icon loading is much faster now if a small sample PNG image exists as Prefs/ENV-Archive/Datatypes/1.PNG. This is used to find the installed PNG datatype only once and then establish it as the default decoder to avoid wasting a lot of time with trying out all other picture datatype descriptors again and again for every icon.

You can use akPNG, PNGdt or WarpPNG. The latter has two possible settings:
1.) Use the AplhaChannel with a black background, which is better for the GlowRevolution icons, but worse for others. This is also the way PNGdt works.
2.) Ignore the AlphaChannel like akPNG, which is better for the samples of PowerIcons and most other icon collections.

Unfortunately, akPNG has a memory loss of 48 bytes per icon and WarpPNG loses 24 bytes per icon. Only the PNGdt from Gunther Nikl has no memory losses.

There is still no DualPNG support yet. Give me some more time please.
Btw, the icon snapshot is only possible after converting them with WB:icon->information. Just select a bunch of icons all together with the lasso and then save them at once with WB:icon->info from a big stack of requesters. Of course, that will remove the TrueColor data and the second image atm !

Update below: http://eab.abime.net/showpost.php?p=751162&postcount=67

@James
Thanks a lot for your suggestion. I've seen that already before but didn' play with it yet. I'm missing something like a SDK or an autodoc description. Another possibility could be the iconobject.library system from Scalos. It supports ARGB directly, but not everybody has these files installed.

@Minous
Quote:
...You are not happy with the current toolbar and want transparent PNG toolbar icons!? I would still have to pick a default background colour so I don't think the effect would be really different...
Sorry, I don't know anything about your tooolbar, but since I couldn't use the AlphaChannel data for transparency I decided to fake Alpha data with these two simple rules: If either a pixels ARGB is 0/0/0/0 or the same as the ARGB of the first pixel (upper left corner) then make it transparent. In any other case its color is 100% visible. This is indeed a really big assumption, but it seems to work in more than 95% of all cases.The only sideeffect are sometimes some transparent holes in the image.
Code:
                    MOVEA.L        $34(SP),A0               ; start of image
                    MOVE.L         (A0),D2                  ; color of first pixel
                    MOVE.L         D4,D0
                    LSL.L          #2,D0                    ; 4 * full size
                    ADDA.L         D0,A0                    ; + start of image
                    MOVE.L         A0,$38(SP)               ; = end of image
                    SUBQ.B         #mskHasAlpha,bmh_Masking(A4)
                    BEQ.S          .hasAlphaChannel
                    MOVE.L         D4,D0
                    SUBQ.L         #1,D0
.fakeAlphaChannel   MOVE.L         -(A0),D1                 ; color = black ?
                    BEQ.S          .settransparency
                    CMP.L          D2,D1                    ; color of 1. pixel ?
.settransparency    SNE.B          (A0)                     ; if not make visible
                    DBRA.S         D0,.fakeAlphaChannel
.hasAlphaChannel   .....

Last edited by PeterK; 21 April 2011 at 07:53.
PeterK is offline  
Old 28 March 2011, 20:51   #29
mfilos
Paranoid Amigoid
 
mfilos's Avatar
 
Join Date: Mar 2008
Location: Athens/Greece
Age: 45
Posts: 1,978
Thanks for the constant updates Peter mate! Just tested it and it works just fine \o/
mfilos is offline  
Old 29 March 2011, 14:40   #30
matthey
Banned
 
Join Date: Jan 2010
Location: Kansas
Posts: 1,284
Hi Peter,

I have a question about this part of your code...

Quote:
Originally Posted by PeterK View Post
Code:
.fakeAlphaChannel
                    MOVE.L        -(A0),D1                 ; color = black ?
                    BEQ.S          .settransparency
                    CMP.L          D2,D1                    ; color of 1. pixel ?
.settransparency
                    SNE.B          (A0)                     ; if not make visible
                    DBRA.S        D0,.fakeAlphaChannel
.hasAlphaChannel   .....
It looks to me like the pixel is already transparent (alpha=0) when the color is black (0/0/0/0) so there is no need to set transparency (alpha=0) with SNE. When the BEQ is taken to .settransparency, the SNE will never change the alpha byte from 0 because the CC zero flag is still set. If this is as you intended, then consider jumping to .settransparency+2 skipping the SNE and a wasted write. Consider this code...

Code:
                    MOVEA.L      $34(SP),A0        ; start of image
                    MOVE.L        D4,D0               ;reduces change/use stall
                    MOVE.L        (A0),D2             ; color of first pixel
                    LEA           (A0,D4*4),A0     ; image start + size*4
                    MOVE.L        A0,$38(SP)        ; = end of image
                    SUBQ.B        #mskHasAlpha,bmh_Masking(A4)
                    BEQ.S          .hasAlphaChannel
                    SUBQ.L        #1,D0
.fakeAlphaChannel
                    MOVE.L        -(A0),D1            ; color = black ?
                    BEQ.S          .keeptransparent
                    CMP.L          D2,D1                ; color of 1. pixel ?
                    SNE.B          (A0)                  ; if not make visible
.keeptransparent
                    DBRA.S        D0,.fakeAlphaChannel
This code does not write the pixel when it's black and transparent. Would it be better to make black with any value for it's alpha channel be transparent? I also made a few changes pre-loop that saves several cycles on the 68040+ and 2 bytes without compromising 68020/68030 performance. Notice that moving the MOVE.L D4,D0 to the 2nd line saves a cycle of change/use stall and using the LEA eliminates the need for the 2nd MOVE.L D4,D0.

Nice job on the PNG support and thanks for the updates.

Last edited by matthey; 30 March 2011 at 02:32. Reason: Re-thinking
matthey is offline  
Old 29 March 2011, 20:54   #31
James
Registered User
 
Join Date: Mar 2010
Location: Beckenham/England
Posts: 795
Disabled AfA icon support to test this new library on my WinUAE setup - vey nice!

Noticed just 2 small probs:

BenchTrash reverted to an old icon.

Directories set to show only icons displayed all their contents.

Thanks again for this!
James is offline  
Old 29 March 2011, 20:58   #32
amigakit.com
Registered User
 
amigakit.com's Avatar
 
Join Date: Aug 2004
Location: www.amigakit.com
Posts: 2,015
Yes, many thanks. Great work- good to see Classic development.
amigakit.com is offline  
Old 01 April 2011, 01:03   #33
PeterK
Registered User
 
Join Date: Apr 2005
Location: digital hell, Germany, after 1984, but worse
Posts: 3,365
@matthey
Thank you for your suggestions. Indeed, the black pixels won't need the SNE. I've overseen this, because in some previous versions there was still a certain level of darkness (AND.L #$00F1F1F1, D1) used as the criteria for transparency and also a little different code.

As you already know, my knowledge of the 68040/60 and the according optimization is nearly zero. But I will make use of your hints, of course. THANKS!

@James
Confirmed: I've noticed this directory behaviour already but thought that I changed the settings before and just set them back to 'display icons only'. Should be fixed soon. Thank you!

Last edited by PeterK; 01 April 2011 at 01:10.
PeterK is offline  
Old 01 April 2011, 05:53   #34
matthey
Banned
 
Join Date: Jan 2010
Location: Kansas
Posts: 1,284
Quote:
Originally Posted by PeterK View Post
@matthey
Thank you for your suggestions. Indeed, the black pixels won't need the SNE. I've overseen this, because in some previous versions there was still a certain level of darkness (AND.L #$00F1F1F1, D1) used as the criteria for transparency and also a little different code.
It tricked me at first too . I could see experimenting with the algorithm more to better recognize transparent pixels. The current algorithm is fast though.

Quote:
As you already know, my knowledge of the 68040/60 and the according optimization is nearly zero. But I will make use of your hints, of course. THANKS!
It's never too late to learn . The Natami N68k processors are designed very similar to the 68060 so it will become more common. The change/use penalty is explained in this Natami thread...

http://www.natami.net/knowledge.php?...80&order=&x=10

I've improved my understanding and assembler coding from this thread as some concepts like this are not documented very well.
matthey is offline  
Old 01 April 2011, 12:34   #35
PeterK
Registered User
 
Join Date: Apr 2005
Location: digital hell, Germany, after 1984, but worse
Posts: 3,365
The first Dual-PNG version for AGA is done now. Improvements for a better AlphaChannel -> transparency support and for more speed may follow asap.

@James
The problem with the drawers showing all files instead of icons only is really a bug in the PNG icOn chunk which wants to set the drawer flags to a value of 3 ?? I couldn't find anything defining values above 2. I don't have a problem with the benchtrash icon here. Maybe you've already saved the old image before I implenented the PNG image support ? Restore the icon from your collection again.

Last edited by PeterK; 02 April 2011 at 02:47.
PeterK is offline  
Old 01 April 2011, 12:51   #36
mfilos
Paranoid Amigoid
 
mfilos's Avatar
 
Join Date: Mar 2008
Location: Athens/Greece
Age: 45
Posts: 1,978
PeterK awesome!!!
Gonna try it right away.

We still need the 1.png under Datatypes folder in Env-Archive right?
mfilos is offline  
Old 01 April 2011, 12:57   #37
PeterK
Registered User
 
Join Date: Apr 2005
Location: digital hell, Germany, after 1984, but worse
Posts: 3,365
Quote:
We still need the 1.png under Datatypes folder in Env-Archive right?
Yes, the 1.PNG file in ENV: Datatypes is really important for more speed (appoximately +30% ). Of course, it will also work without the 1.PNG file.
PeterK is offline  
Old 01 April 2011, 13:41   #38
gulliver
BoingBagged
 
gulliver's Avatar
 
Join Date: Aug 2007
Location: The South of nowhere
Age: 46
Posts: 2,358
@Peterk

Thank you for your commitment and hard work on this library, it is truly outstanding


PS: Snapshot was taken on AGA 256 colors screen under AmigaOS 3.9 with KensIcons v4
Attached Thumbnails
Click image for larger version

Name:	01.png
Views:	317
Size:	34.1 KB
ID:	28265  
gulliver is offline  
Old 01 April 2011, 13:46   #39
mfilos
Paranoid Amigoid
 
mfilos's Avatar
 
Join Date: Mar 2008
Location: Athens/Greece
Age: 45
Posts: 1,978
Just tested it under my WinUAE Amiga clone...

It looks awesome!!!

- In first screenshot you can see both Ken's Icons (v4) and MasonIcons under A1200 AGA (256colors)
- In second screenshot you can see both Ken's Icons (v4) and MasonIcons under A600 ECS (16colors with Rebel's Palette)

Totally cool!!!
Attached Thumbnails
Click image for larger version

Name:	NewIconLib.png
Views:	502
Size:	51.2 KB
ID:	28266   Click image for larger version

Name:	NewIconLibECS.png
Views:	335
Size:	42.5 KB
ID:	28268  

Last edited by mfilos; 01 April 2011 at 13:58.
mfilos is offline  
Old 01 April 2011, 14:03   #40
PeterK
Registered User
 
Join Date: Apr 2005
Location: digital hell, Germany, after 1984, but worse
Posts: 3,365
Many thanks to gulliver and mfilos !!

Btw, I've just added the 1.PNG again to the lha file in my posting above.
Now, I should write to the authors of the PNG datatypes first, ask them how to get better AlphaChannel and 2. image support and if they could fix the memory losses. I will also try to use other PNG decoding methods in the next days.
PeterK is offline  
 


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools

Similar Threads
Thread Thread Starter Forum Replies Last Post
C Code without official includes redblade Coders. Language 3 20 March 2013 14:05
A new OFFICIAL AmigaOne 500 DDNI News 49 18 July 2012 16:08
some goodies not in official .dat thevoice project.TOSEC (amiga only) 8 11 November 2006 12:35
The Official "Newly Aquired Games" thread StarEye project.SPS (was CAPS) 42 24 February 2006 01:33
official - CD32 better than dreamcast tin Retrogaming General Discussion 7 16 April 2004 21:43

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +2. The time now is 00:27.

Top

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.
Page generated in 0.10749 seconds with 16 queries