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 Wed 01 Oct 2014, 11:07
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 2 of 2 Posts_count   Goto page: Previous 1, 2
Author Message
vovchik


Joined: 23 Oct 2006
Posts: 1285
Location: Ukraine

PostPosted: Thu 17 Sep 2009, 10:24    Post_subject:  

Dear wjaguar,

Everything works as you said it would. My mtpaintrc file looks like this:
Code:

# choose a location (directory) for your mtpaint theme (icon dir)

pixmap_path "/root/.mtpaint-theme/"

# icon definitions go here

style "mtPaint" { stock["mtpaint_brcosa"] = { { "mtpaint_brcosa.png",*, *, * } } }
style "mtPaint" { stock["mtpaint_case"] = { { "mtpaint_case.png",*, *, * } } }
style "mtPaint" { stock["mtpaint_centre"] = { { "mtpaint_centre.png",*, *, * } } }
style "mtPaint" { stock["mtpaint_cline"] = { { "mtpaint_cline.png",*, *, * } } }
style "mtPaint" { stock["mtpaint_clone"] = { { "mtpaint_clone.png",*, *, * } } }
style "mtPaint" { stock["mtpaint_close"] = { { "mtpaint_close.png",*, *, * } } }
style "mtPaint" { stock["mtpaint_config"] = { { "mtpaint_config.png",*, *, * } } }

.... (and so on)

widget_class "*" style "mtPaint"


many thanks and kind regards,
vovchik
Back to top
View user's profile Send_private_message 
ttuuxxx


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

PostPosted: Thu 17 Sep 2009, 12:45    Post_subject:  

Hi vovchik when your finished could you please post a skinned version Smile with the mtpaintrc and icons. That would save everybody a lot of time figuring it, I'm more foccused on 2.20 and don't have time figure this out from scratch.
Thanks
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_website 
vovchik


Joined: 23 Oct 2006
Posts: 1285
Location: Ukraine

PostPosted: Thu 17 Sep 2009, 13:48    Post_subject:  

Dear ttuuxxx,

Here is my mtpaintrc and my .mtpaint-theme (hidden) dir full of png icons. I bashed this set together quickly, using some of your icons and some others that are supposed to match my OSX GTK/KDE/QT/IceWM themes. All this should be unpacked in /root.

With kind regards,
vovchik

PS. More work could be done, as evidenced by my screen shot
mtpaint-pic.jpg
 Description   
 Filesize   18.78 KB
 Viewed   436 Time(s)

mtpaint-pic.jpg

mtpaint-stuff.tar.gz
Description 
gz

 Download 
Filename  mtpaint-stuff.tar.gz 
Filesize  69.12 KB 
Downloaded  349 Time(s) 
Back to top
View user's profile Send_private_message 
ttuuxxx


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

PostPosted: Thu 17 Sep 2009, 14:00    Post_subject:  

vovchik wrote:
Dear ttuuxxx,

Here is my mtpaintrc and my .mtpaint-theme (hidden) dir full of png icons. I bashed this set together quickly, using some of your icons and some others that are supposed to match my OSX GTK/KDE/QT/IceWM themes. All this should be unpacked in /root.

With kind regards,
vovchik

PS. More work could be done, as evidenced by my screen shot


vovchik it saves me a lot of time so thank you 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_website 
wjaguar

Joined: 21 Jun 2006
Posts: 273

PostPosted: Thu 17 Sep 2009, 14:40    Post_subject:  

vovchik wrote:
Here is my mtpaintrc and my .mtpaint-theme (hidden) dir full of png icons.

Good that you included setting "gtk-icon-sizes" in your mtpaintrc. But for best results, the size which mtPaint uses should be set to precisely the unscaled size of the icons. Like this:
Code:
gtk-icon-sizes="gtk-small-toolbar=22,22"

Because, see, GTK's image scaling code is completely braindead, and its results are of a very bad quality. Sad

And if an icon is originally larger than needed, it is better to rescale it with mtPaint, than leave the job to GTK+.
First, "Scale canvas" - with default "Blackman-Harris" method, gamma correction enabled, and "Sharper image reduction" in settings toggled on.
Then, "Unsharp mask" for improving the contrast - a good working recipe is one pass with radius 1 and amount 0.40, and then another with radius 30 and amount 0.10. (This is what Wikipedia engine does when serving reduced-size images, since 2007.)

BTW, image scaling was the reason why I got involved with mtPaint: no existing program was able to do it properly, so I had to implement it myself. Smile
Back to top
View user's profile Send_private_message 
technosaurus


Joined: 18 May 2008
Posts: 4351

PostPosted: Sun 15 Nov 2009, 19:17    Post_subject:  

wjaguar has added many features - here is a build for testing
(no external images in this one - just the default builtins)
mtPaint-3.34.33-i486.pet
Description 
pet

 Download 
Filename  mtPaint-3.34.33-i486.pet 
Filesize  235.63 KB 
Downloaded  322 Time(s) 

_________________
Web Programming - Pet Packaging 100 & 101
Back to top
View user's profile Send_private_message 
technosaurus


Joined: 18 May 2008
Posts: 4351

PostPosted: Fri 01 Jun 2012, 16:33    Post_subject:  

I wanted to have more colors in my xpm files without adding unnecessary size, this tarball contains a patch to allow mtpaint to use 92 colors vs 64, it is also set up so that it can more easily be modified for more than 2 characters wide. (the tarball also has a few builtin xpms that were reduced by about 1kb total)

here is what it looks like:

Code:
--- src/png.c~   2012-03-01 06:33:16.000000000 +0800
+++ src/png.c   2012-06-01 17:30:10.950797471 +0800
@@ -3925,8 +3925,8 @@ fail:   fclose(fp);
    return (res);
 }
 
-static const char base64[] =
-   "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",
+static const char ascii[] =
+   "!#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[]^_`abcdefghijklmnopqrstuvwxyz{|}~",
    hex[] = "0123456789ABCDEF";
 
 /* Extract valid C identifier from filename */
@@ -3947,7 +3947,7 @@ static int save_xpm(char *file_name, ls_
 {
    unsigned char rgbmem[XPM_MAXCOL * 4], *src;
    const char *ctb;
-   char ws[3], *buf, *tmp;
+   char ws[4], *buf, *tmp;
    str_hash cuckoo;
    FILE *fp;
    int bpp = settings->bpp, w = settings->width, h = settings->height;
@@ -4001,7 +4001,8 @@ static int save_xpm(char *file_name, ls_
       trans = settings->xpm_trans;
    }
 
-   cpp = cols > 64 ? 2 : 1;
+   cpp = cols > (strlen(ascii)+1) ? 2 : 1;
+   /* cpp = cols > ((strlen(ascii)+1)*(strlen(ascii)+1)) ? 3 : cpp; */
    buf = malloc(w * cpp + 16);
    if (!buf) return -1;
 
@@ -4022,19 +4023,21 @@ static int save_xpm(char *file_name, ls_
    else fprintf(fp, "\"%d %d %d %d\",\n", w, h, cols, cpp);
 
    /* Create colortable */
-   ctb = cols > 16 ? base64 : hex;
-   ws[1] = ws[2] = '\0';
+   ctb = cols > 16 ? ascii : hex;
+   ws[1] = ws[2] = '\0'; /* ws[3]='\0'; */
    for (i = 0; i < cols; i++)
    {
       if (i == trans)
       {
          ws[0] = ' ';
          if (cpp > 1) ws[1] = ' ';
+         /* if (cpp > 2) ws[2] = ' '; */
          fprintf(fp, "\"%s\tc None\",\n", ws);
          continue;
       }
-      ws[0] = ctb[i & 63];
-      if (cpp > 1) ws[1] = ctb[i >> 6];
+      ws[0] = ctb[i % strlen(ascii)];
+      if (cpp > 1) ws[1] = ctb[i / strlen(ascii)];
+      /* if (cpp > 2) ws[2] = ctb[i / (strlen(ascii)*strlen(ascii))]; */
       src = rgbmem + i * 4;
       fprintf(fp, "\"%s\tc #%02X%02X%02X\",\n", ws,
          src[0], src[1], src[2]);
@@ -4052,8 +4055,10 @@ static int save_xpm(char *file_name, ls_
          if (k == trans) tmp[0] = tmp[1] = ' ';
          else
          {
-            tmp[0] = ctb[k & 63];
-            tmp[1] = ctb[k >> 6];
+         
+            tmp[0] = ctb[k % strlen(ascii)];
+            tmp[1] = ctb[k / strlen(ascii)];
+            /* tmp[2] = ctb[k / (strlen(ascii)*strlen(ascii))]; */
          }
       }
       strcpy(tmp, i < h - 1 ? "\",\n" : "\"\n};\n");

to add 3+ character wide support ws[3] would need to be increased to ws[4] and would need to compute ws[2] and tmp[2], which is basically i or k / (strlen(ascii)*strlen(ascii)) ... I think, if not, its a good place to start
xpm_colors.patch.gz
Description  updated patch fixes colors > 184 and has 3 wide support commented out for future use
gz

 Download 
Filename  xpm_colors.patch.gz 
Filesize  1 KB 
Downloaded  192 Time(s) 
fixed_icons.tar.gz
Description 
gz

 Download 
Filename  fixed_icons.tar.gz 
Filesize  2.45 KB 
Downloaded  204 Time(s) 

_________________
Web Programming - Pet Packaging 100 & 101
Back to top
View user's profile Send_private_message 
technosaurus


Joined: 18 May 2008
Posts: 4351

PostPosted: Fri 01 Jun 2012, 20:45    Post_subject:  

I just realized the hex part may be broken... Need to test something with 16 colors, but it looks like it may be totally unnecessary anyways.
_________________
Web Programming - Pet Packaging 100 & 101
Back to top
View user's profile Send_private_message 
Display_posts:   Sort by:   
Page 2 of 2 Posts_count   Goto page: Previous 1, 2
Post_new_topic   Reply_to_topic View_previous_topic :: View_next_topic
 Forum index » Advanced Topics » Additional Software (PETs, n' stuff) » Graphics
Jump to:  

Rules_post_cannot
Rules_reply_cannot
Rules_edit_cannot
Rules_delete_cannot
Rules_vote_cannot
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB © 2001, 2005 phpBB Group
[ Time: 0.0777s ][ Queries: 13 (0.0047s) ][ GZIP on ]