Post all Gimp scripts and script writing questions here
Post a reply

Re: XNViewShell - and other Programs you can call with Gimp

Tue Apr 05, 2011 3:03 pm

lylejk wrote: I remember Microsoft was working on a product, I believe, called Acryllic that would have been a true raster/vector editor, but believe that project died.


I know a fellow who swears by Xara Extreme (now Xara Designer?): http://www.xara.com/us/products/designer/features/

This seems a true hybrid vector/raster editor.

-Rob A>

Re: ShellOut.py (was XNViewShell) - Call external programs

Tue Apr 05, 2011 4:26 pm

A very interesting vector/raster hybrid is RealDraw...that too the mix even add a touch of 3D
http://www.mediachance.com/realdraw/

Re: XNViewShell - and other Programs you can call with Gimp

Wed Apr 06, 2011 3:11 pm

Rod wrote:I believe you have to call the extension from the command line Marero.
Code:
["XNView", "\"C:\\Program Files\\XnView\\xnview.exe\"", "bmp"],

or
Code:
["XNView", "\"C:\\Program Files\\XnView\\xnview.exe\"", "jpg"],

or
Code:
["XNView", "\"C:\\Program Files\\XnView\\xnview.exe\"", "png"],


That is supposed to tell the program Gimp to save the temp file as an certain extension, and open it in that program as that extension i believe.
I did try it this way and it didn't work.


Bringing this back on topic :P This syntax will now work, Rod, for software that will not work with png files.

-Rob A>

Re: ShellOut.py (was XNViewShell) - Call external programs

Fri Apr 22, 2011 1:47 pm

Versions lower than 0.5 to write the temporary file:
c: \ Documents and Settings \ ~ ~ \. gimp-2.6 \ tmp \

Version 0.5 saves the temporary file to:
c: \ Documents and Settings \ ~ ~ \ Local Settings \ Temp \

What is due? On which it depends?

Maybe the next version of the file selection tmp / Temp? (application without a direct return to the Gimp - for example delienate [http://delineate.sourceforge.net/])

or an indication that piece of code decides this?
Code:
from gimpfu import *
import math
   
def pyTmp(image, drawable, visible):
   pdb.gimp_file_save(image, drawable, visible, "")
register(
   "python_fu_temp_png",
   "Temp",
   "Temp",
   "MrQ",
   "",
   "2011",
   "<Image>/File/TEMP(png)",
   "RGB*, GRAY*",
   [
      (PF_STRING, "png_filename", "Filename to export", "C:\\TEMP\\walk.png"),
   ],
   [],
   pyTmp)

main()


A piece of code to write in a specific location work - if it can connect to se ShellOut?

Re: ShellOut.py (was XNViewShell) - Call external programs

Fri Apr 22, 2011 2:45 pm

This is very interesting Rob because now i can export images from Gimp as SVG to Inkscape. :)
Or any other file to its program in that programs native format. - in theory - Correct?

Marero my temp png file always saves in Local Settings/Temp
Just as i typed this the server went down for update. :lol
O i hope you backed up the database! :)

Re: ShellOut.py (was XNViewShell) - Call external programs

Tue Apr 26, 2011 6:27 pm

Rod wrote:This is very interesting Rob because now i can export images from Gimp as SVG to Inkscape. :)
Or any other file to its program in that programs native format. - in theory - Correct?


Not really, as Gimp has no "save" as SVG.

-Rob A>

Re: ShellOut.py (was XNViewShell) - Call external programs

Tue Apr 26, 2011 7:05 pm

I have used this:
Export as SVG

Re: ShellOut.py (was XNViewShell) - Call external programs

Tue Apr 26, 2011 7:43 pm

Fair enough but that doesn't export anything vector (svg) just a bunch of raster images. It is just as effective to send it to inkscape as a PNG.

-Rob A>

Re: ShellOut.py (was XNViewShell) - Call external programs

Wed Apr 27, 2011 3:22 pm

Old Times - a little grief ... svg-path-export.scm

And the collection ShellOut - Jdraw_v1.1.5.jar
http://jdraw.sourceforge.net/index.php?page=6

Re: ShellOut.py (was XNViewShell) - Call external programs

Tue Feb 07, 2012 11:07 am

Use from Shellout:
["Menu Label", "command", "ext"]
it change file extension - but not a real format.
You can see in the header - or open it in IrfanView.
Example http://www.gimpchat.com/viewtopic.php?f=22&t=1873&start=20#p46115
Or is it possible to add one more option to Shelout ?

The addition of various:

pdb.file_png_save …
pdb.file_tiff_save2…

and actual choice: bmp, jpg, png, tiff …
(or use the corresponding pdb.file_xyz_save…. according to the given extension).

Re: ShellOut.py (was XNViewShell) - Call external programs

Tue Feb 07, 2012 11:50 am

Good catch! I had some old code from when it was just png.

Change this:
Code:
  pdb.file_png_save_defaults(tempimage, tempdrawable, tempfilename, tempfilename)


To this:
Code:
  pdb.gimp_file_save(tempimage, tempdrawable, tempfilename, tempfilename)


I've updated the attachment two pages back.

-Rob A>

Re: ShellOut.py (was XNViewShell) - Call external programs

Tue Feb 07, 2012 12:33 pm

I thought the choice of changing procedures - perhaps unnecessarily.
Now it works OK.
Thank you very much - You are wonderful!

Ps.
"Local Settings" has properties - hidden (unavailable for some programs).
How to in Shellout set the location ( select - important to override the file ) of the file (ShellOutTempFile) in another directory ? Can I change the code to write ShellOutTempFile in a specific directory?
Optimally selected in Preferences-> Folders-> Temporary Folder.

Re: ShellOut.py (was XNViewShell) - Call external programs

Tue Feb 07, 2012 2:58 pm

I just call pdb.gimp_temp_name which provides an appropriate temporary file and directory. If you want to specify it uncomment out the first line and comment out the second one in this bit of code:

Code:
  # Use temp file names from gimp, it reflects the user's choices in gimp.rc
  # change as indicated if you always want to use the same temp file name
  # tempfilename = pdb.gimp_temp_name(progtorun[2])
  tempfilename = os.path.join(tempfile.gettempdir(), "ShellOutTempFile."+progtorun[2])


-Rob A>

Re: ShellOut.py (was XNViewShell) - Call external programs

Wed Mar 28, 2012 2:02 pm

Reading
http://docs.gimp.org/2.6/en/gimp-fire-up.html#gimp-concepts-running-language
Another GIMP instance
Use -n to run multiple instances GIMP. For example, use gimp-2.6 to start GIMP in the default system language, and LANGUAGE=en gimp-2.6 -n to start another instance of GIMP in English; this is very useful for translators.

ShellOut (0.7) is also a way to simultaneously run multiple versions of the GIMP (XP 32bit)- the transfer of image and language selection (to 2.6 - in the 2.7 range in the preferences).

Edit the path and choose the LANGUAGE:
for example :multigimp-2.6.bat
Code:
@echo off
echo *** Do Not Close this Window ***
echo Temp File: %1
set LANGUAGE=en
"C:\Program Files\GIMP-2.0\bin\gimp-2.6.exe" -n %1


for example multigimp-2.7.bat
Code:
@echo off
echo *** Do Not Close this Window ***
echo Temp File: %1
set LANGUAGE=pl
"C:\Program Files\GIMP 2.7\bin\gimp-2.7.exe" -n %1


ShellOut programlist = [
Code:
  ["GIMP 2.6", "\"C:\\Bat\\multigimp-2.6.bat\"", "png"],
  ["GIMP 2.7", "\"C:\\Bat\\multigimp-2.7.bat\"", "png"],

Re: ShellOut.py (was XNViewShell) - Call external programs

Wed Mar 28, 2012 2:07 pm

That is cool; can now run GIMP 2.8 64-bit but still have access to all the cool GIMP 2.6 plugins too. Thanks MareroQ. I doubt Mathmap, for instance, will ever get ported to 64-bit GIMP. It will slow things down a bit to do things though; may even continue to run 2.6.12 32-bit because of that because of 64-bit lack of support (mini wishlist to include PSPI, Mathmap, and Filter Factory (user filter) Convertor). Not sure I would even really use he new features in 2.8, but then again.... lol

:)

Re: ShellOut.py (was XNViewShell) - Call external programs

Wed Mar 28, 2012 8:12 pm

Thanks Marero, now i can load Gimp-2.6 and use the python word art plugin through Gimp-2.7. :)

Re: ShellOut.py (was XNViewShell) - Call external programs

Wed Mar 28, 2012 8:22 pm

Never thought about going the other way Rod; isn't Shellout grand? I say yes. Shellout is a game changer no doubt. Indeed, I might actually have GIMP 2.6.12 call out GIMP 2.8x for the few features that I may need in the new GIMP since I know the GIMP plugins that I can not live without won't get ported to GIMP 2.8 64-bit immediately (and maybe never). :)

Re: ShellOut.py (was XNViewShell) - Call external programs

Thu Mar 29, 2012 8:49 pm

lylejk wrote:Never thought about going the other way Rod; isn't Shellout grand? I say yes. Shellout is a game changer no doubt. Indeed, I might actually have GIMP 2.6.12 call out GIMP 2.8x for the few features that I may need in the new GIMP since I know the GIMP plugins that I can not live without won't get ported to GIMP 2.8 64-bit immediately (and maybe never). :)


Shellout is an awesome addition to the program, and i recommend it to all those who use Python-Fu.
It definitely changed the way i use Gimp, and some Adobe plug-ins that PSPI seems to have a hard time with. :)
Thanks again Rob, and MareroQ!

Re: ShellOut.py (was XNViewShell) - Call external programs

Fri Mar 30, 2012 11:06 am

I tried to run shellout for GIMP 1.2.4 but keep getting a libgtk0.dll can't be found or something like that. I even tried to include the path for this library to no avail. Not too important but wish that it could be done. Oh well. :)

Re: ShellOut.py (was XNViewShell) - Call external programs

Fri Mar 30, 2012 10:41 pm

Just out of curiosity
http://www.gimpchat.com/viewtopic.php?f=15&t=3965
Post a reply