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 Mon 24 Nov 2014, 12:31
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 [23 Posts]   Goto page: Previous 1, 2
Author Message
vovchik


Joined: 23 Oct 2006
Posts: 1287
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: 10843
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 poster's website 
vovchik


Joined: 23 Oct 2006
Posts: 1287
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   460 Time(s)

mtpaint-pic.jpg

mtpaint-stuff.tar.gz
Description 
gz

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


Joined: 05 May 2007
Posts: 10843
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 poster's website 
wjaguar

Joined: 21 Jun 2006
Posts: 291

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: 4378

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  327 Time(s) 

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


Joined: 18 May 2008
Posts: 4378

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  196 Time(s) 
fixed_icons.tar.gz
Description 
gz

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

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


Joined: 18 May 2008
Posts: 4378

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 from previous:   Sort by:   
Page 2 of 2 [23 Posts]   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:  

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.0816s ][ Queries: 12 (0.0078s) ][ GZIP on ]