Resources and Support
 Pixel Joint Forum : The Lounge : Resources and Support
Message Icon Topic: DB ToolBox - Grafx2 scripts UPDATED dec13 Post Reply Post New Topic
Page  of 2 Next >>
Author Message
DawnBringer
Commander
Commander
Avatar

Joined: 01 April 2015
Online Status: Offline
Posts: 492
Quote DawnBringer Replybullet Topic: DB ToolBox - Grafx2 scripts UPDATED dec13
    Posted: 30 August 2011 at 8:14pm
UPDATE! TOOLBOX v1.3 zip-archive
Ten new scripts, f.ex one that allows you to design geometric shapes as aid for your sprites and art. Added Dennis' winning palette to the custom presets.



Documentation updated with many pictures (also included in the zip-archive), here's the online version: ToolBox v1.3 documentation

zip-archive

(13 Dec 2011).
--

Right, so here's the story... there's a nice little pixelprogram called Grafx2 and in the recent years we have greatly developed its scripting ability (well, I request features and others implement ;))


Now I have written about 100 more or less useful scripts for different Color, Brush, Palette & Image operations. Luckily Grafx2-scripting allows for a simple window/menu system...so all the scripts can be launched from a single mainscript - The ToolBox, and this can be assigned to a key if desired. And you're welcome to try & use them if you like!

Here's a zip-archive with the scripts and some instructions. Note that you may need a recent version of Grafx2 for all scripts to work (there's links in the instructions). Some scripts/algorithms are still WIP/Experimental...but that shouldn't stop you from having some fun.

Some of the stuff you can find in there:

* MANY Palette analysis & optimation tools
* 3D-palette viewer
* AA-color finders
* Brightness/Hue/Contrast/Balance/Saturation/Lightness adjustment for Palette, Brush or Color (top quality)
* Tint/Colorize (Image & Brush)
* RetroFormat remapping
* C64-format testing
* Brush-2-Image, Image-2-Brush, Crop Brush Margins
* Curved Color Ramps (wip)
* Image effects & filters
* Palette/Histogram/Mixcolortable to Brush
* RubThru Pencolor (Spare 2 Main)
* TileSheet reorganizer
and much, much more...

If you have any problems just let me know.

I'd love to see more people try some Grafx2 Lua-scripting!

Grafx2 Homepage
And here's the page with scripting information: Brush Factory


Edited by DawnBringer - 31 December 2012 at 2:18pm
IP IP Logged
ChrisButton
Commander
Commander
Avatar

Joined: 10 September 2010
Online Status: Offline
Posts: 371
Quote ChrisButton Replybullet Posted: 31 August 2011 at 7:15am
Thank you! :-D
IP IP Logged
vulthoom
Seaman
Seaman


Joined: 22 August 2011
Online Status: Offline
Posts: 7
Quote vulthoom Replybullet Posted: 31 August 2011 at 11:26am
Thaank you! =]
I swear, i'll try to make some lua, and i post here.

After much time, u 3d palette viwer is AWESOME *-*


Edited by vulthoom - 31 August 2011 at 2:00pm
IP IP Logged
iLKke
Seaman
Seaman
Avatar

Joined: 20 December 2015
Online Status: Offline
Posts: 6
Quote iLKke Replybullet Posted: 05 September 2011 at 4:40am
Thanks for the awesome script, man!
Also, thanks for letting me betatest the c64 script :D
IP IP Logged
jalonso
Admiral
Admiral
Avatar

Joined: 14 June 2016
Online Status: Offline
Posts: 13537
Quote jalonso Replybullet Posted: 06 September 2011 at 6:04pm
Do these scripts work on the Mac version?
How does a non-geek add them?

*The zip version link is not extracting on my Mac so I can't see what these directions are.
IP IP Logged
DawnBringer
Commander
Commander
Avatar

Joined: 01 April 2015
Online Status: Offline
Posts: 492
Quote DawnBringer Replybullet Posted: 06 September 2011 at 8:47pm
Hm, the Mac-version of Grafx2 has been a long running problem, but I think the 2.3 version released in May should be ok!? If you have that one and it's working you should be able to run most Lua-scripts.

Note however that new scripting features are frequently added and it's usually only the windows-version of Grafx2 that is released as betas. Some of my scripts use newer instructions that probably don't work with 6 month old versions of the program...but most scripts should still function fine I hope.

I only included a link to the latest windows-beta in the readme.txt, you should find a Mac version here:

Downloads

Instruction how to install (just some moving/copying) the scripts are also in the readme.txt. The directory-structure is a bit different on Mac, zip-archive has been updated with new instructions.




Edited by DawnBringer - 07 September 2011 at 4:53pm
IP IP Logged
yrizoud
Commander
Commander
Avatar

Joined: 27 April 2017
Location: France
Online Status: Offline
Posts: 326
Quote yrizoud Replybullet Posted: 07 September 2011 at 6:57am
DawnBringer: I think your scripts will only work if the libraries are in scripts/libs, because the command "require" doesn't precise where the libraries can be found. There's a problem with some of your scripts that require("memory"), because this one is not in your zip, and in a 2.3 package it's in scripts/samples_2.3/libs/

(The sample scripts of 2.3 use dofile() which supports directories, whereas require() doesn't : dofile("../libs/dawnbringer_lib.lua")

The difference between OSX and Linux/Windows is that the scripts directory is the directory Contents\Resources\scripts\ in the bundle, instead of (where_you_installed_it)/share/grafx2/scripts/.
Other than that, it should behave similarly.
IP IP Logged
Mrmo Tarius
Commander
Commander
Avatar

Joined: 12 February 2016
Online Status: Offline
Posts: 367
Quote Mrmo Tarius Replybullet Posted: 07 September 2011 at 9:58am
I need to try these out right away. Thanks for making and sharing this!

Edited by Mrmo Tarius - 07 September 2011 at 9:58am
IP IP Logged
DawnBringer
Commander
Commander
Avatar

Joined: 01 April 2015
Online Status: Offline
Posts: 492
Quote DawnBringer Replybullet Posted: 07 September 2011 at 5:05pm
Oh yeah, I almost forgot about that recent change with "samples", I'm just using the old system with the root "libs"-dir. Figure I'll update the scripts some day with "dofile" so everything can fit in one drawer...but you know 100 scripts, phew! Thanx for the OSX info, I feared it would be different.

Anyways, I updated the zip-archive with the recent installation-info and the missing memory-lib.
IP IP Logged
PulkoMandy
Midshipman
Midshipman


Joined: 30 June 2009
Location: France
Online Status: Offline
Posts: 44
Quote PulkoMandy Replybullet Posted: 10 September 2011 at 12:42am
Should be possible to update these scripts easily with some unix shell magic. I'll have a look at that :)

edit: done !
http://pulkomandy.lexinfo.fr/drop/dawnscripts_dofile.zip

Trick used :

sed -e 's!require("\(.*\)")!dofile("../libs/\1.lua")!g' -i *.lua

(make a backup first, as this will replace the original files).
I hope everything is ok with the result :)

Edited by PulkoMandy - 10 September 2011 at 12:49am
IP IP Logged
DawnBringer
Commander
Commander
Avatar

Joined: 01 April 2015
Online Status: Offline
Posts: 492
Quote DawnBringer Replybullet Posted: 10 September 2011 at 6:07am
Ok, thanx. First I was thinking it would be better to put the "libs" inside "dawn" and redo your process with new paths. But instead I could put the scripts in a sub-dir and put the toolbox-script alone in the root of "dawn"...just have to update the paths, but that's simply a textreplacement.

Like this: (your "../libs" change should work here)

[dawn]
. toolboxscript.lua
. [scripts]
. [libs]

This have to be the simplest and most userfriendly structure, right?

UPDATE: Nope, that won't work as paths are relative to the inital script (the toolbox) and not any consequentally executed script. But it will work if the toolbox script is put back in the same place/level as the other scripts.

Edited by DawnBringer - 10 September 2011 at 10:39am
IP IP Logged
MyO
Seaman
Seaman
Avatar

Joined: 12 January 2011
Online Status: Offline
Posts: 22
Quote MyO Replybullet Posted: 13 September 2011 at 4:16am
Gh, now I start to think that I should have bought a smartphone. There is no way GrafX2 can be ported to J2ME, is there?


Edited by MyO - 13 September 2011 at 4:47am
IP IP Logged
PulkoMandy
Midshipman
Midshipman


Joined: 30 June 2009
Location: France
Online Status: Offline
Posts: 44
Quote PulkoMandy Replybullet Posted: 14 September 2011 at 10:47am
J2ME can't be done. Sorry :(

You can buy a GP2X / Wiz /Caanoo, I think that's currently the best way to carry GrafX2 around.
IP IP Logged
surt
Commander
Commander
Avatar

Joined: 30 December 2015
Online Status: Offline
Posts: 408
Quote surt Replybullet Posted: 14 September 2011 at 11:31pm
It could also be possible that there is a port of SDL for your dumb-phone's OS  (I believe there's one for S60 for example) which might allow you to build it natively for your phone.
IP IP Logged
MyO
Seaman
Seaman
Avatar

Joined: 12 January 2011
Online Status: Offline
Posts: 22
Quote MyO Replybullet Posted: 15 September 2011 at 2:33am
Not a chance: my phone is Sony Ericsson Cedar -- it supports J2ME application only.
There are a few nice paint programs I know about, with some neat features like palette support, Bezier curves, transparency support and tools for making animated GIF's, but...
Oh well, perhaps this is not a huge loss. Even if GrafX2 on my cellphone doubled the amount of my pixel productivity comparing to the present, it wouldn't make much difference, for I have 0 pixel-pieces in my private gallery right now.


Edited by MyO - 15 September 2011 at 2:34am
IP IP Logged
yrizoud
Commander
Commander
Avatar

Joined: 27 April 2017
Location: France
Online Status: Offline
Posts: 326
Quote yrizoud Replybullet Posted: 15 September 2011 at 7:41am
After a bit of search about this phone, I can't see any indication that it has a touchscreen. Grafx2 is mouse-oriented, and pretty useless on plaforms with no mouse or a *precise* stylus.

IP IP Logged
Mrmo Tarius
Commander
Commander
Avatar

Joined: 12 February 2016
Online Status: Offline
Posts: 367
Quote Mrmo Tarius Replybullet Posted: 17 September 2011 at 12:50pm
I use a samsung galaxy s + bluetooth mouse combo for grafx2 portability :P
IP IP Logged
mdog95
Commander
Commander
Avatar

Joined: 07 October 2011
Online Status: Offline
Posts: 150
Quote mdog95 Replybullet Posted: 26 November 2011 at 2:20pm
Annoying question:

Which script runs this palette analysis?



It's one of the only ones I really want to use, and I can't find it :P
IP IP Logged
Pandora'sSecret
Commander
Commander
Avatar

Joined: 05 February 2017
Online Status: Offline
Posts: 79
Quote Pandora'sSecret Replybullet Posted: 26 November 2011 at 3:06pm
hmm, you have actually gotten further than I did. I don't even get to the part where i know how to open these LUa's ...

Perhaps there is a really noobfriendly guide as to how to use these things, cause I really would like to make use of the 3D palette animation..
IP IP Logged
mdog95
Commander
Commander
Avatar

Joined: 07 October 2011
Online Status: Offline
Posts: 150
Quote mdog95 Replybullet Posted: 26 November 2011 at 3:25pm
Actually, you know what, I did everything on the readme, and the folders don't show up in Grafx. My computer originally wouldn't open the .zip folder, so I force extracted the folders, then put them where the readme said, and... only the sample folder is there. I tried restarting and all that.
IP IP Logged
DawnBringer
Commander
Commander
Avatar

Joined: 01 April 2015
Online Status: Offline
Posts: 492
Quote DawnBringer Replybullet Posted: 26 November 2011 at 5:17pm
@Pandora: Right-click the "Brush-effects / factory" button at the center-bottom menu, left of the text-tool. The 3D-Palette is bundled with Grafx2 (Samples2.4/Demo).

@mdog95: What version of Grafx2 are you running?



Edited by DawnBringer - 26 November 2011 at 5:18pm
IP IP Logged
mdog95
Commander
Commander
Avatar

Joined: 07 October 2011
Online Status: Offline
Posts: 150
Quote mdog95 Replybullet Posted: 26 November 2011 at 6:01pm
I just updated it to the latest today before I put the scripts in.
IP IP Logged
DawnBringer
Commander
Commander
Avatar

Joined: 01 April 2015
Online Status: Offline
Posts: 492
Quote DawnBringer Replybullet Posted: 26 November 2011 at 7:35pm
You can try the newer version available from my profile page; you should be able to place them anywhere in your system (make a dir for them first, I forgot that) and run them from there.

Assign a hot-key for ToolBox script (ex. Alt-1) for easy access.

http://goto.glocalnet.net/axe/dawntb12d.zip
IP IP Logged
mdog95
Commander
Commander
Avatar

Joined: 07 October 2011
Online Status: Offline
Posts: 150
Quote mdog95 Replybullet Posted: 26 November 2011 at 8:35pm
It still doesn't work. Is this the latest version, or is my computer screwing me again?





The stuff just isn't showing up :/
IP IP Logged
DawnBringer
Commander
Commander
Avatar

Joined: 01 April 2015
Online Status: Offline
Posts: 492
Quote DawnBringer Replybullet Posted: 26 November 2011 at 8:44pm
Where did you put it? That's a fileselector, it shows what's there. You can navigate out of Grafx2 if needed.

Wait v2.3... get a recent 2.4WIP to make sure things work like intended:

http://grafx2.googlecode.com/files/grafx2-2.4wip1866-win32.zip

Edited by DawnBringer - 26 November 2011 at 8:47pm
IP IP Logged
mdog95
Commander
Commander
Avatar

Joined: 07 October 2011
Online Status: Offline
Posts: 150
Quote mdog95 Replybullet Posted: 26 November 2011 at 9:20pm
Now I have 2.4, and it's still not working. I still only get the sample_2.4. I don't know why the folders don't show up.
IP IP Logged
DawnBringer
Commander
Commander
Avatar

Joined: 01 April 2015
Online Status: Offline
Posts: 492
Quote DawnBringer Replybullet Posted: 26 November 2011 at 9:39pm
Probably coz you haven't put anything there...go into the Grafx2 dirs with a filemanager and make sure.
IP IP Logged
mdog95
Commander
Commander
Avatar

Joined: 07 October 2011
Online Status: Offline
Posts: 150
Quote mdog95 Replybullet Posted: 26 November 2011 at 9:45pm




They're everywhere they could possibly be, and I get nothing. I hope this is what you mean by the dirs...
IP IP Logged
DawnBringer
Commander
Commander
Avatar

Joined: 01 April 2015
Online Status: Offline
Posts: 492
Quote DawnBringer Replybullet Posted: 27 November 2011 at 12:04am
Put the drawer where Grafx2 is looking for scripts, which is: grafx2\share\grafx2\scripts


Or, if you're using the +1.2 version you can place the scripts anywhere and use the brushfactory-fileselector and navigate to wherever they are located on your computer. Just make sure that my "scripts" and "libs" are present at the same level.

(Sorry if things can be a little messy, but Grafx2 is changing and improving all the time, and the script-system has changed over the last year. And I'm trying to adapt the ToolBox to work as smootly as possible...so don't give up yet! ;))


Edited by DawnBringer - 27 November 2011 at 12:05am
IP IP Logged
DawnBringer
Commander
Commander
Avatar

Joined: 01 April 2015
Online Status: Offline
Posts: 492
Quote DawnBringer Replybullet Posted: 13 December 2011 at 12:51pm
V1.3 released, see first post.
IP IP Logged
yrizoud
Commander
Commander
Avatar

Joined: 27 April 2017
Location: France
Online Status: Offline
Posts: 326
Quote yrizoud Replybullet Posted: 13 December 2011 at 1:11pm
I've noticed something weird in the online docs, when you click an image it zooms it, like +12.5% at a time, but after 3 times it zooms out 8 times smaller than original. A remainder of a time when each click zoomed +100% ?

IP IP Logged
DawnBringer
Commander
Commander
Avatar

Joined: 01 April 2015
Online Status: Offline
Posts: 492
Quote DawnBringer Replybullet Posted: 13 December 2011 at 1:36pm
It works fine in IE and Opera but I do notice now that it now stopped working correctly in the last version of FireFox (there you go, another reason not to use that browser anymore...I've grown so tired of all the FF crap and constant changes that I only Opera nowdays). What browser do you use?

Correct behaviour is, by each click from the original: +100%, +200%, +300%, +400%, reset to original.

I'm doing this, don't know why it fails in FF.

<script>
   for (var n=0; n<document.images.length; n++){
    document.images[n].data = [document.images[n].width, document.images[n].height, 0]
    document.images[n].onclick = function() {if(this.data[2]<3){this.width+=this.data[0];this.data[2]+=1}else{this.width=this.data[0];this.data[2]=0;}}
   }
</script>



Edited by DawnBringer - 13 December 2011 at 1:40pm
IP IP Logged
yrizoud
Commander
Commander
Avatar

Joined: 27 April 2017
Location: France
Online Status: Offline
Posts: 326
Quote yrizoud Replybullet Posted: 14 December 2011 at 4:24am
(Sorry for the slight JS offtopic)
It looks as if the javascript runs "too early", before all images are downloaded, so the width/height return a default value of 16x16 or something.
If I reload the page, the images are in browser cache, so it starts working correctly.

IP IP Logged
DawnBringer
Commander
Commander
Avatar

Joined: 01 April 2015
Online Status: Offline
Posts: 492
Quote DawnBringer Replybullet Posted: 14 December 2011 at 6:20am
Yeah, you're right. I've updated the online-version now to assign the zoom-feature after the page is completely loaded. Thanx.
IP IP Logged
DawnBringer
Commander
Commander
Avatar

Joined: 01 April 2015
Online Status: Offline
Posts: 492
Quote DawnBringer Replybullet Posted: 30 December 2011 at 5:59pm
Testing. Testing. This thread disappeared after spam-cleaning. [Seems like that comment bumped it out of oblivion]

Well, while I'm here why not list the stuff done so far for V1.4

* Ping-Pong mode for the Sprite-Sheet Animator added, max frame size now 512x512.

* Re-Tiler now allows 512x512, BG clearing.

* A new Image Statistics script

* A new Threshold + Apply FG->BG Gradient script

* Difference mode added to Apply Spare script

* A new Difference script that allows you to extract the difference of two images.



Edited by DawnBringer - 30 December 2011 at 6:08pm
IP IP Logged
neota
Commander
Commander
Avatar

Joined: 29 January 2016
Online Status: Offline
Posts: 154
Quote neota Replybullet Posted: 23 January 2012 at 7:23pm
I'm interested in these scripts (That's a lot of work right there.. Respect.).
I always prefer to use the very latest version though, so... Do you have these in a GIT or SVN repository somewhere? (I particularly want to be able to use PingPong mode in the animator.)

Edit:
_DB_TOOLBOX is buggy on Linux. You are giving some filenames that are wrong (incorrect case).


Here's a diff correcting that:


--- __DBTOOLBOX.lua     2011-12-13 01:58:36.000000000 +1030
+++ _DBTOOLBOX.lua      2012-01-24 14:40:19.000000000 +1030
@@ -76,7 +76,7 @@
     "3D Palette Viewer (i)",   function () dofile("ani_db_3DPalette.lua"); end,
     "Curved ColorRamps (p)",   function () dofile("pal_db_CurveRamps.lua"); end,
     --"Reduce (Rare) Cols (i,p)",   function () dofile("scn_db_RemoveRarePixels.lua"); end,     
-    "SuperSort (p)",           function () dofile("pal_db_Supersort6.lua"); end,
+    "SuperSort (p)",           function () dofile("pal_db_SuperSort6.lua"); end,
     "Shuffle Palette (p)",     function () dofile("pal_db_ShufflePal.lua"); end,
     "Assign Spare 2 Current (p)",   function () dofile("pal_db_assignPalette.lua"); end,
     "[Back]", main
@@ -100,7 +100,7 @@
   selectbox("Brush Distortions",
     "Rotation (i/b)",             function () preBRU=1; prePIC=0; dofile("scn_db_Rotation.lua"); end,
     "Waves (i/b)",                function () preBRU=1; prePIC=0; dofile("scn_db_Waves_aa.lua"); end,
-    "FishEye (i/b)",              function () preBRU=1; prePIC=0; dofile("scn_db_FishEye.lua"); end,
+    "FishEye (i/b)",              function () preBRU=1; prePIC=0; dofile("scn_db_Fisheye.lua"); end,
     "[Back]", sf_brush
  );
 end
@@ -188,7 +188,7 @@
     ">OPTIMIZE & REMAP", sf_img_optimize,
     ">DISTORTIONS", sf_img_distort,
     ">DRAW SHAPES & GRIDS", sf_img_draw,
-    "Set Image Size (i)",        function () dofile("pic_db_setImageSize.lua"); end,
+    "Set Image Size (i)",        function () dofile("pic_db_SetImageSize.lua"); end,
     "Image 2 Brush (b)",         function () dofile("bru_db_Picture2Brush.lua"); end,
     "Fill Color w/ Brush (i)",   function () dofile("pic_db_FillColorWithBrush.lua"); end,
     "RubThru PenColor (i)",      function () dofile("pic_db_RubthruPencolor.lua"); end,
@@ -273,7 +273,7 @@
 function sf_demo()
   selectbox("Demos & Fun",     
   "Amiga BoingBall Brush (b)",function () dofile("bru_db_Amigaball.lua"); end,
-  "Oblique Logo (i)",         function () dofile("pic_db_obliqueLogo.lua"); end,
+  "Oblique Logo (i)",         function () dofile("pic_db_ObliqueLogo.lua"); end,
   "Line Demo (i)",            function () dofile("pic_db_LineDemo.lua"); end,
   --"TicTacToe Game! (i,p)",    function () dofile("scn_db_TicTacToe.lua"); end,
   "[Back]", sf_scene
@@ -326,7 +326,7 @@
   "Palette Operators  (i,p)",function () dofile("ani_db_PaletteOperators.lua"); end,
   "Spline Demo (i)",function () dofile("ani_db_SplineDemo.lua"); end,
   "Ellipse Demo (i,p)",function () dofile("ani_db_EllipseDemo.lua"); end,
-  "Iso Train (i,p)",function () dofile("ani_db_IsoTrain.lua"); end,
+  "Iso Train (i,p)",function () dofile("ani_db_isoTrain.lua"); end,
   "Oblique Palette Cubes (i)",function () dofile("ani_db_ObliquePal.lua"); end,
   "[Back]", main
  );




Edited by neota - 23 January 2012 at 9:14pm
absolutely.
IP IP Logged
DawnBringer
Commander
Commander
Avatar

Joined: 01 April 2015
Online Status: Offline
Posts: 492
Quote DawnBringer Replybullet Posted: 23 January 2012 at 11:31pm
Ah, thanx for telling. It did occur to me the other day that some links had letters in the wrong case, but in windows it works fine, so I didn't sweat it. Though I'll be sure to fix this in the next update.

And, no...no repository for these scripts other than my computer ;) But give me an e-mail and I can send you the latest version the SpriteSheet-animator or any other script you like.

Edited by DawnBringer - 23 January 2012 at 11:35pm
IP IP Logged
sandrowski
Seaman
Seaman
Avatar

Joined: 26 December 2009
Online Status: Offline
Posts: 2
Quote sandrowski Replybullet Posted: 04 April 2012 at 4:41am
hi there!
first of all - sorry for my bad ENG language, i was bad in school :)

i download DBToolBox1.3. okay! good job!

But i have a trouble :(

1.
for example
:
i load my pic. after i chose _DBTOOLBOX>Image>Distortions>fisheye.
but i have error message - cannot open scn_db_FishEye.lua (no such file or dir)
it's sad :(

2.
okay
i chose Misc>PenColorSphere
but again error!
now i see message like "Error running script: bru_db_ColorSphere.lua:36: attempt to call global 'matchcolor2' (a nil value)"

how i can fix it? or what i did wrong?

p.s. grafx2 (ubuntu ver)


Edited by sandrowski - 04 April 2012 at 4:43am
IP IP Logged
DawnBringer
Commander
Commander
Avatar

Joined: 01 April 2015
Online Status: Offline
Posts: 492
Quote DawnBringer Replybullet Posted: 04 April 2012 at 5:10am
1. Sorry, my fault...I mixed the lettercasing, the name of the physical script is "scn_db_Fisheye.lua" not "scn_db_FishEye.lua". Windows don't care so these (there are a few) wasn't noticed until recently. Will have this fixed in next version. For now you can either rename the script or edit the toolbox script (_DBTOOLBOX.lua). You can also run the script directly without going via the ToolBox.

2. Yeah, some of the scripts use new/wip features added to the Lua-scripting. I'm not sure if the latest Ubuntu versions has those implemented yet. But always get the latest version of Grafx2 for best compability.

Edited by DawnBringer - 04 April 2012 at 5:13am
IP IP Logged
yrizoud
Commander
Commander
Avatar

Joined: 27 April 2017
Location: France
Online Status: Offline
Posts: 326
Quote yrizoud Replybullet Posted: 04 April 2012 at 12:24pm
You could provide a bit of compatibility in the library, using something like :

function db.matchcolor2(...)
 ...
end
-- If grafx2 doesn't provide matchcolor2(), replace it with a lua implementation
if (not type(matchcolor2) == 'function') then
 matchcolor2 = db.matchcolor2
end

Same with drawline() :
if (not type(drawline) == 'function') then
 drawline = db.line
end

IP IP Logged
DawnBringer
Commander
Commander
Avatar

Joined: 01 April 2015
Online Status: Offline
Posts: 492
Quote DawnBringer Replybullet Posted: 06 April 2012 at 3:58pm
@Yrizoud: Ah, right...that's good to know. However in the case of matchcolor2 I would either have to re-route to matchcolor - which may give a different result, or use my own, very slow function which now also would require a palette-list to be generated at every call...effectively make it slit-your-throat slow.

...but maybe I could use this to present informative messages rather than having the scripts cryptically fail.
IP IP Logged
Mark_Ian
Seaman
Seaman


Joined: 20 September 2012
Online Status: Offline
Posts: 3
Quote Mark_Ian Replybullet Posted: 21 September 2012 at 7:43am
its complicated to run the scripts, but well worth it. thanks
IP IP Logged
DawnBringer
Commander
Commander
Avatar

Joined: 01 April 2015
Online Status: Offline
Posts: 492
Quote DawnBringer Replybullet Posted: 21 September 2012 at 8:13am
What makes it complicated exactly? You can just assign the Toolbox to a shortkey, I hope you know. Or do you find the scripts themselves complicated (coz yes, some of them are quite cryptical esp. since there isn't much room for explanations).

I'm getting pretty close to finish v1.4, so if there's anything ppl liked to see added or changed, now's the time to shout!
IP IP Logged
yrizoud
Commander
Commander
Avatar

Joined: 27 April 2017
Location: France
Online Status: Offline
Posts: 326
Quote yrizoud Replybullet Posted: 23 September 2012 at 6:57am
If the library is designed for a recent v2.4wip, can you please use the new "run()" instead of "dofile()" ? It helps the scripts run on other OSes.
Also, it doesn't have the same problem as dofile() with relative directories.

IP IP Logged
DawnBringer
Commander
Commander
Avatar

Joined: 01 April 2015
Online Status: Offline
Posts: 492
Quote DawnBringer Replybullet Posted: 23 September 2012 at 8:48am
Hm, ok. And with this at the start of the Toolbox...

if (type(run) == 'function') then
dofile = run
end

...There would be no need to change anything and it would be compatiable with older versions, right. (Running individual script directly would still use the real "dofile" however).
IP IP Logged
yrizoud
Commander
Commander
Avatar

Joined: 27 April 2017
Location: France
Online Status: Offline
Posts: 326
Quote yrizoud Replybullet Posted: 23 September 2012 at 10:22am
Yes, and if you keep the scripts (menu + individual scripts) in the same directory, it will keep working with older versions of Grafx2 too (we haven't even released 2.4, so 2.3 will stay the most frequent Linux version for a while)

IP IP Logged
neota
Commander
Commander
Avatar

Joined: 29 January 2016
Online Status: Offline
Posts: 154
Quote neota Replybullet Posted: 24 April 2013 at 4:06pm
FYI, something has changed in recent GrafX2 versions. the 'Resize image' script is no longer working (produces scrambled noise). The settings I use are just : Double X, Double Y, Simple Scale
absolutely.
IP IP Logged
DawnBringer
Commander
Commander
Avatar

Joined: 01 April 2015
Online Status: Offline
Posts: 492
Quote DawnBringer Replybullet Posted: 24 April 2013 at 4:40pm
Ok, that's a little weird as that's a pretty basic script. What's Grafx2 version are you running right now (I'm running 2.4.2035).
If you'd like you could test the latest (unreleased) version of the Toolbox and see if it has the same problems.
IP IP Logged
neota
Commander
Commander
Avatar

Joined: 29 January 2016
Online Status: Offline
Posts: 154
Quote neota Replybullet Posted: 24 April 2013 at 5:53pm
SVN r2062. Just to be sure I completely rebuilt and reinstalled GrafX2. No change in results.

Of course I won't pass up any opportunity to get my hands on the latest Toolbox :D PM'd.
(I agree that the script in question is so simple it can hardly go wrong, but it's worth a try.)

Edit: It turns out that this is probably a bug in Grafx2 getbackuppixel()


Edited by neota - 25 April 2013 at 12:04am
absolutely.
IP IP Logged
neota
Commander
Commander
Avatar

Joined: 29 January 2016
Online Status: Offline
Posts: 154
Quote neota Replybullet Posted: 25 April 2013 at 12:11am
I have found a fix: Insert a line 'finalizepicture()' after the setpicturesize(picX, picY) line

This is probably just a workaround, as it seems to me that the backup buffer should already contain some kind of sensible content at the point you go to scale the image. Anyway, if you're experiencing this, it's a usable workaround if you only want to scale up. It doesn't work for scaling down..

EDIT: yrizoud has confirmed that this bug was introduced in r2052 of GrafX2 (see the bug report)


Edited by neota - 25 April 2013 at 3:20am
absolutely.
IP IP Logged
Page  of 2 Next >>
Post Reply Post New Topic
Printable version Printable version

Forum Jump
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot delete your posts in this forum
You cannot edit your posts in this forum
You cannot create polls in this forum
You cannot vote in polls in this forum