Puppy Linux Discussion Forum Forum Index Puppy Linux Discussion Forum
Puppy HOME page : puppylinux.com
"THE" alternative forum : puppylinux.info
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

The time now is Thu 24 Jul 2014, 00:40
All times are UTC - 4
 Forum index » Advanced Topics » Additional Software (PETs, n' stuff) » Graphics
mtpaint 3.34+svn
Post new topic   Reply to topic View previous topic :: View next topic
Page 1 of 2 [23 Posts]   Goto page: 1, 2 Next
Author Message
technosaurus


Joined: 18 May 2008
Posts: 4277

PostPosted: Tue 15 Sep 2009, 23:30    Post subject:  mtpaint 3.34+svn  

I compiled the latest mtPaint as a single compile (for >100kb or ~20% size reduction) the executable is now only 400kb

If someone wants to update/modernize the icons I will recompile it (see icons1.tar.gz)

FYI to get it to compile this small I had to do this in directory src:
Code:

 gcc  -pipe -combine -Os -fno-pic -fno-PIC -ffunction-sections -fdata-sections \
 -momit-leaf-frame-pointer -fomit-frame-pointer -fmerge-all-constants \
 -mpreferred-stack-boundary=2  -march=i386 -mtune=i386 \
 -I/usr/include/gtk-2.0 -I/usr/lib/gtk-2.0/include -I/usr/include/atk-1.0 \
 -I/usr/include/cairo -I/usr/include/pango-1.0 -I/usr/include/glib-2.0 \
 -I/usr/lib/glib-2.0/include -I/usr/include/pixman-1 -I/usr/include/freetype2 \
 -I/usr/X11R7/include -I/usr/include/libpng12 \
 -DHAVE_MKDTEMP -DU_GIF -DU_JPEG -DU_TIFF -DU_FREETYPE -DU_FPICK_GTKFILESEL -DU_CPICK_GTK \
 -I/usr/include/freetype2 -DVERSION="\"mtPaint 3.31 Puppy Linux Edition"\" \
 main.c mainwindow.c inifile.c png.c memory.c canvas.c otherwindow.c mygtk.c \
 viewer.c polygon.c layer.c info.c wu.c prefs.c ani.c mtlib.c toolbar.c channels.c \
 csel.c shifter.c spawn.c font.c fpick.c icons.c cpick.c -o mtpaint \
 -Wl,-O,-Os,--gc-sections,-s,--no-keep-memory,--as-needed \
 /usr/lib/libgif.so /usr/lib/libjpeg.so /usr/lib/libtiff.so /usr/lib/libpng.so \
 /usr/lib/libgtk-x11-2.0.so /usr/lib/libgdk-x11-2.0.so /usr/lib/libatk-1.0.so \
 /usr/lib/libgio-2.0.so /usr/lib/libpangoft2-1.0.so /usr/lib/libgdk_pixbuf-2.0.so \
 /usr/lib/libpangocairo-1.0.so /usr/lib/libcairo.so /usr/lib/libpango-1.0.so \
 /usr/lib/libfreetype.so /lib/libz.so /usr/X11R7/lib/libfontconfig.so \
 /usr/lib/libgobject-2.0.so /usr/lib/libgmodule-2.0.so /usr/lib/libglib-2.0.so -s
strip --strip-all --remove-section=.comment --remove-section=.note mtpaint
mtPaint-3.34.33-i486.pet
Description 
pet

 Download 
Filename  mtPaint-3.34.33-i486.pet 
Filesize  235.63 KB 
Downloaded  433 Time(s) 
icons1.tar.gz
Description 
gz

 Download 
Filename  icons1.tar.gz 
Filesize  11.52 KB 
Downloaded  430 Time(s) 
mtpaint-3.31.1-i486.pet
Description 
pet

 Download 
Filename  mtpaint-3.31.1-i486.pet 
Filesize  215.6 KB 
Downloaded  450 Time(s) 

_________________
Web Programming - Pet Packaging 100 & 101

Last edited by technosaurus on Sun 15 Nov 2009, 19:19; edited 2 times in total
Back to top
View user's profile Send private message 
wjaguar

Joined: 21 Jun 2006
Posts: 241

PostPosted: Wed 16 Sep 2009, 03:44    Post subject: Crippling other people's software is nothing to be proud of  

technosaurus wrote:
FYI to get it to compile this small I had to do this in directory src:

A great example how failing to read docs leads one to heroically "solving" the wrong problem. Sad
Code:
./configure release gtkfilesel gtkcolsel nojp2

- results in a 429 Kb binary, when stripped the same way as yours - with full performance optimizations. While the one you produced is 400 Kb - optimized for size. Paying a 50% performance hit for 29 Kb of diskspace pre-compression - quite a tradeoff indeed. Rolling Eyes

BTW, none in the mixed bag of extra compiler options you've added have any positive effect on binary size - except "-Wl,--gc-sections" which saved whopping 120 bytes. Wink


-= With best regards, Dmitry Groshev, maintainer of mtPaint =-
Back to top
View user's profile Send private message 
ttuuxxx


Joined: 05 May 2007
Posts: 10747
Location: Ontario Canada,Sydney Australia

PostPosted: Wed 16 Sep 2009, 06:47    Post subject:  

Well I re-themed my compile with tango/gnome icons which were bigger in overall size 22x22 instead of 20x20 but fix mostly on the 20x20 layer, still more colours etc and well it grew a bit, but I would rather have it look newer and toss like 45kb's out the door Smile
Anyway can we could get a png version instead of xpm, the icon sizes would be a lot smaller plus when changing from tango png to xpm formats the transparencies get too dark and ruined. Thanks for your great product Smile
ttuuxxx
mtpaint-3.31-i386.pet
Description 
pet

 Download 
Filename  mtpaint-3.31-i386.pet 
Filesize  259.55 KB 
Downloaded  445 Time(s) 
mtpaint.jpeg
 Description   
 Filesize   21.86 KB
 Viewed   1091 Time(s)

mtpaint.jpeg


_________________
http://audio.online-convert.com/ <-- excellent site
http://samples.mplayerhq.hu/A-codecs/ <-- Codec Test Files
http://html5games.com/ <-- excellent HTML5 games Smile

Back to top
View user's profile Send private message Visit poster's website 
wjaguar

Joined: 21 Jun 2006
Posts: 241

PostPosted: Wed 16 Sep 2009, 08:05    Post subject:  

ttuuxxx wrote:
Well I re-themed my compile with tango/gnome icons which were bigger in overall size 22x22 instead of 20x20 but fix mostly on the 20x20 layer, still more colours etc and well it grew a bit, but I would rather have it look newer and toss like 45kb's out the door Smile

Yes, definitely looks nice with these icons. But myself, I still prefer the original set - I like sharp outlines more than alpha blending.

Quote:
Anyway can we could get a png version instead of xpm, the icon sizes would be a lot smaller plus when changing from tango png to xpm formats the transparencies get too dark and ruined.

To compile PNG icons into the binary, I'll need to write something to convert them into C source code - directly converting them to object files is architecture dependent:
Code:
objcopy -I binary -O elf32-i386 -B i386 $< $@

But won't it be better to simply make mtPaint themeable? I can add "Default theme" entry to "Preferences->Paths", accepting a gtkrc file like the one here: /usr/share/gimp/2.0/themes/Default/imagerc . Then, everyone could easily switch to whatever iconset one prefers. The cost in terms of code size will be slight.
And naturally, this will support PNG icons out of the box.
Back to top
View user's profile Send private message 
ttuuxxx


Joined: 05 May 2007
Posts: 10747
Location: Ontario Canada,Sydney Australia

PostPosted: Wed 16 Sep 2009, 09:37    Post subject:  

wow that would be excellent if you could do that, then the icons would look 10X times better quality. They would have the same quality as gimp, because they are the same tango ones used by gimp, They lost a lot of quality when converting the original png to xpm, below is the same icons used in gimp. Plus it would make others who are used to gimp to know there way around mtpaint, now if we could just have a layers and colour wheel selection stationary on the right hand side, Wink
ttuuxxx
gimp.jpeg
 Description   
 Filesize   13.27 KB
 Viewed   1098 Time(s)

gimp.jpeg


_________________
http://audio.online-convert.com/ <-- excellent site
http://samples.mplayerhq.hu/A-codecs/ <-- Codec Test Files
http://html5games.com/ <-- excellent HTML5 games Smile

Back to top
View user's profile Send private message Visit poster's website 
technosaurus


Joined: 18 May 2008
Posts: 4277

PostPosted: Wed 16 Sep 2009, 10:09    Post subject: Re: Crippling other people's software is nothing to be proud of  

wjaguar wrote:
While the one you produced is 400 Kb - optimized for size. Paying a 50% performance hit for 29 Kb of diskspace pre-compression - quite a tradeoff indeed. Rolling Eyes


What is the 50% performance hit based on? Is that real world experience with your program or just a rule of thumb? I did some basic usage tests with -O2, -Os and -O3 and at least on my main 1.8ghz machine there was no noticable difference. I may pull out my DECtop (geode gx2) and run tests on it to verify, but I may wait for the theming - sounds great.

The reason I build it that way instead of using the make files is to test the effects of different optimizations (for myown educational purposes) -combine only works on .c files and not .o files and that tends to improve both performance and size (it works even better in later versions of gcc)

@ttuuxxx looks pretty good and it may actually save some size if there is theming since we could just use some symlinks then.

_________________
Web Programming - Pet Packaging 100 & 101
Back to top
View user's profile Send private message 
wjaguar

Joined: 21 Jun 2006
Posts: 241

PostPosted: Wed 16 Sep 2009, 11:02    Post subject:  

ttuuxxx wrote:
wow that would be excellent if you could do that, then the icons would look 10X times better quality.

Technically, this is easy to do (now that I know how); the largest problem for me is actually assembling a set of icon files to test it on. Smile
So it would be appreciated if you sent me the icons you used for your mtPaint build (PNGs, not XPMs) - my time saved on searching for the wherever the original files are on the Web, could then be put to better use actually implementing theming support. Wink

Quote:
now if we could just have a layers and colour wheel selection stationary on the right hand side

Actually, layers are there already, in current dev version:
http://mtpaint.sourceforge.net/temp/mtpaint-3.34.16.tar.bz2
Now, if layers window or settings toolbar aren't open as separate window, they are instead placed into the dock pane: "View->Show Dock"

As for colour selector (which one, BTW - A&B, or palette editor?), it is technically possible to put it in dock as well - but there is already no space remaining in the first pane, with settings and layers in there. So it'll have to go onto another page of the dock, and therefore could be shown only while settings-and-layers page is hidden.
Also, there is a separate question of undoing changes; now it is obvious - change to palette is pushed onto undo stack when user presses OK - but when to do so if colour editor is non-modal? (One more-or-less sensible possibility is - "when colour editor loses input focus".)

BTW, dynamic preview for all colour editors is already implemented in dev branch as well - the "Preview" button is now a toggle.
Back to top
View user's profile Send private message 
wjaguar

Joined: 21 Jun 2006
Posts: 241

PostPosted: Wed 16 Sep 2009, 11:23    Post subject: Re: Crippling other people's software is nothing to be proud  

technosaurus wrote:
What is the 50% performance hit based on? Is that real world experience with your program or just a rule of thumb?

This is Gaussian blur working 1.5 times slower on the machine I'm writing this on. The filter I normally use as a performance measure.

Quote:
I did some basic usage tests with -O2, -Os and -O3 and at least on my main 1.8ghz machine there was no noticable difference.

Given that mtPaint is designed to handle "basic usage" even on a 486, the slowdown should have been an order of magnitude greater to be noticeable that way. Which is why I use a processing-heavy filter for testing performance.

Quote:
The reason I build it that way instead of using the make files is to test the effects of different optimizations (for myown educational purposes)

This is what I said about ignoring the docs. Sad I've already tested available gcc options extensively, some time ago; picked those few optimizations which improve performance without disproportionately increasing the binary size, and made ' ./configure release ' enable them, and also disable GTK's debug code.

Quote:
-combine only works on .c files and not .o files and that tends to improve both performance and size (it works even better in later versions of gcc)

On gcc 3.4.6, no effect at all; will try on gcc 4.2.3 later today and see what happens.

EDIT: And what happened was: on gcc 4.2.3, "-combine" saved 140 bytes.

Last edited by wjaguar on Thu 17 Sep 2009, 13:39; edited 1 time in total
Back to top
View user's profile Send private message 
ttuuxxx


Joined: 05 May 2007
Posts: 10747
Location: Ontario Canada,Sydney Australia

PostPosted: Wed 16 Sep 2009, 11:42    Post subject:  

wjaguar wrote:
ttuuxxx wrote:
wow that would be excellent if you could do that, then the icons would look 10X times better quality.

Technically, this is easy to do (now that I know how); the largest problem for me is actually assembling a set of icon files to test it on. Smile
.


Ok I'll do it, I'm in the middle of making a gtk2 theme so I'll be about 1hr or so Smile
ttuuxxx

_________________
http://audio.online-convert.com/ <-- excellent site
http://samples.mplayerhq.hu/A-codecs/ <-- Codec Test Files
http://html5games.com/ <-- excellent HTML5 games Smile

Back to top
View user's profile Send private message Visit poster's website 
ttuuxxx


Joined: 05 May 2007
Posts: 10747
Location: Ontario Canada,Sydney Australia

PostPosted: Wed 16 Sep 2009, 12:48    Post subject:  

Ok here's the icons, There a lot of extras for you to choose from Smile
ttuuxxx
mtpaint-icons.tar.gz
Description 
gz

 Download 
Filename  mtpaint-icons.tar.gz 
Filesize  56.61 KB 
Downloaded  436 Time(s) 

_________________
http://audio.online-convert.com/ <-- excellent site
http://samples.mplayerhq.hu/A-codecs/ <-- Codec Test Files
http://html5games.com/ <-- excellent HTML5 games Smile

Back to top
View user's profile Send private message Visit poster's website 
wjaguar

Joined: 21 Jun 2006
Posts: 241

PostPosted: Wed 16 Sep 2009, 19:06    Post subject:  

ttuuxxx wrote:
Ok here's the icons, There a lot of extras for you to choose from Smile

OK, here is themeable mtPaint, and you can do the choosing yourself. Smile
http://mtpaint.sourceforge.net/temp/mtpaint-3.34.17.tar.bz2

Now for each builtin XPM icon "src/icons1/xpm_whatever.xpm" there is matching stock ID "mtpaint_whatever", and if you define an icon for that ID in 'imagerc' (or whatever you decide to call the theme file), it will override the builtin one.
Naturally, this supports PNG icons and full alpha transparency - both are GTK2's builtin features, I only needed to make use of them.
Back to top
View user's profile Send private message 
technosaurus


Joined: 18 May 2008
Posts: 4277

PostPosted: Wed 16 Sep 2009, 19:52    Post subject:  

Awesome, thanks so much for all your work on mtPaint. It continues to be a very integral part of Puppy.
_________________
Web Programming - Pet Packaging 100 & 101
Back to top
View user's profile Send private message 
vovchik


Joined: 23 Oct 2006
Posts: 1285
Location: Ukraine

PostPosted: Thu 17 Sep 2009, 03:18    Post subject:  

Dear wjaguar,

Thanks very much for the new version of mtpaint and the new theming capability. Could you possibly provide a sample mtpaintrc, or a bit of it, so that I can see the proper syntax. I have tried
Code:

mtpaint_save="/root/media-floppy.png"

as a test but got no results. Without the quotes I got an error message. I am certain that the solution is simple.

With kind regards,
vovchik
Back to top
View user's profile Send private message 
wjaguar

Joined: 21 Jun 2006
Posts: 241

PostPosted: Thu 17 Sep 2009, 04:13    Post subject:  

vovchik wrote:
Could you possibly provide a sample mtpaintrc, or a bit of it, so that I can see the proper syntax.

Here it is:
Code:

gtk-icon-sizes="gtk-small-toolbar=22,22"
style "mtPaint" {
        stock["mtpaint_brcosa"] = {
                { "color-brightness-contrast.png", *, *, * }
        }
# Other icon definitions go here
}
widget_class "*" style "mtPaint"

The complete documentation on allowed syntax and what it means, is here: http://library.gnome.org/devel/gtk/stable/gtk-Resource-Files.html, under the "Styles" heading.

Last edited by wjaguar on Thu 17 Sep 2009, 14:05; edited 1 time in total
Back to top
View user's profile Send private message 
vovchik


Joined: 23 Oct 2006
Posts: 1285
Location: Ukraine

PostPosted: Thu 17 Sep 2009, 04:38    Post subject:  

Dear wjaguar,

Thanks very much. I didn't realize that you were using standard gtk2 rc syntax. I will now try that out and report on my progress.

With kind regards,
vovchik
Back to top
View user's profile Send private message 
Display posts from previous:   Sort by:   
Page 1 of 2 [23 Posts]   Goto page: 1, 2 Next
Post new topic   Reply to topic View previous topic :: View next topic
 Forum index » Advanced Topics » Additional Software (PETs, n' stuff) » Graphics
Jump to:  

You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB © 2001, 2005 phpBB Group
[ Time: 0.1238s ][ Queries: 12 (0.0209s) ][ GZIP on ]