It is currently Fri May 24, 2013 7:40 pm


Latest GIMP Scripts & Plug-ins

All times are UTC - 5 hours [ DST ]




Post new topic Reply to topic  [ 268 posts ]  Go to page Previous  1, 2, 3, 4, 5, 6, 7 ... 27  Next
Author Message
 Post subject: Re: XNViewShell
PostPosted: Fri Jan 07, 2011 10:24 pm  (#31) 
Offline
GimpChat Member

Joined: Oct 06, 2010
Posts: 2688
Bwahahahahahaha. AWESOMENESS! I hereby nominate RobA the Coder of the Year for 2011! Thanks, Rob! W000t! Worked perfectly.

Image
Use of one of my proprietary plug-ins.

Also an interesting observation: this .py plug-in actually got XnView to work properly. Meaning, prior to this, when using XnView, if I closed ANY image after viewing, XnView would crash. I've run several edits, and so far (knocking on wood) XnView hasn't crashed after closing an image.

Many thanks!

_________________
You cannot do a kindness too soon because you never know how soon it will be too late.

~Ralph Waldo Emerson


Top
 Profile  
 

 Post subject: Re: XNViewShell
PostPosted: Fri Jan 07, 2011 10:31 pm  (#32) 
Offline
GimpChat Member
User avatar

Joined: Sep 24, 2010
Posts: 5022
I concur Mahvin. RobA's the coder of the year for sure. Hope he decides to share this Python plugin at the Registry. Can finally say goodbye to PSPI (well, almost; can't get Impressionist to even show up in XNView; lol). :)

_________________
Lyle

Psalm 109:8

Image


Top
 Profile  
 
 Post subject: Re: XNViewShell
PostPosted: Fri Jan 07, 2011 11:04 pm  (#33) 
Offline
GimpChat Member
User avatar

Joined: Jul 04, 2010
Posts: 1380
Location: Slowly Returning to the Living.
I get the menu option, so the path is good. When I select it, a box pops up asking "new from visible" or "current layer", and when I press "ok", I get a progress bar and it creates a new layer, but never launches XnView.

_________________
Artists aren't crazy! We're eccentric! ~G.M. Ross

Image

My Sigs = My Photos
Check out my work at http://www.flickr.com/photos/photomastergreg.


Top
 Profile  
 
 Post subject: Re: XNViewShell
PostPosted: Fri Jan 07, 2011 11:06 pm  (#34) 
Offline
GimpChat Member

Joined: Oct 06, 2010
Posts: 2688
Did you download Rob's latest version? His last zip attachment?

_________________
You cannot do a kindness too soon because you never know how soon it will be too late.

~Ralph Waldo Emerson


Top
 Profile  
 
 Post subject: Re: XNViewShell
PostPosted: Fri Jan 07, 2011 11:18 pm  (#35) 
Offline
GimpChat Member
User avatar

Joined: Jul 04, 2010
Posts: 1380
Location: Slowly Returning to the Living.
I just downloaded the latest, changed the path and it works sweetly with Win7 64bit! Great coding!!

_________________
Artists aren't crazy! We're eccentric! ~G.M. Ross

Image

My Sigs = My Photos
Check out my work at http://www.flickr.com/photos/photomastergreg.


Top
 Profile  
 
 Post subject: Re: XNViewShell
PostPosted: Fri Jan 07, 2011 11:59 pm  (#36) 
Offline
GimpChat Member

Joined: Apr 12, 2010
Posts: 4957
thank RobA

_________________
My 3D Gallery on Deviantart http://photocomix2.deviantart.com/
Main gallery http://www.flickriver.com/photos/photocomix-mandala/
Mandala and simmetry http://www.flickriver.com/photos/photocomix_mandala/

Image

Mrs Wilbress


Top
 Profile  
 
 Post subject: Re: XNViewShell
PostPosted: Sat Jan 08, 2011 5:56 am  (#37) 
Offline
Global Moderator
User avatar

Joined: May 16, 2010
Posts: 9027
Location: "Looking for my eraser" =P
LOL, all i did was copy the XnView directory to a new folder called PF in C directory - opened Gimp and it works now!
Oh and changed the path to PF instead of Program Files.

Thanks Rob!

_________________
Image
Gimp Rocks Blog
Simply Gimp Tutorials
"Once your in the cloud, you're in the net"
____________
OK, . . . . so what's the speed of dark?


Top
 Profile  
 

 Post subject: Re: XNViewShell
PostPosted: Sat Jan 08, 2011 6:49 am  (#38) 
Offline
Global Moderator
User avatar

Joined: Apr 07, 2010
Posts: 6978
I put the new plugin into my 2.6 plugins and XnView now shows under filters. I didn't change any paths, just looked at it with notepad++ and it looks Greek to me...
Anyway, I can see it now. I will have to learn what it does next. :geek thanx RobA

_________________
Image


Top
 Profile  
 
 Post subject: Re: XNViewShell
PostPosted: Sat Jan 08, 2011 7:29 am  (#39) 
Offline
Global Moderator
User avatar

Joined: May 16, 2010
Posts: 9027
Location: "Looking for my eraser" =P
Molly it calls the image program called XnView so you can edit a temp image in it with photo-shop filters as they run better in Xnview. Then it reopens it in Gimp with the changes....

sweet guess what i did Rob?

I altered your code just a little to call Deep Paint .. here is the code.
Code:
#!/usr/bin/env python

'''
DeepPaintShell.py
call DeepPaint ro allow processing using photoshop plugins.  Windows Only.

Author:
Rob Antonishen

this script is modelled after the mm extern LabCurves trace plugin
by Michael Munzert http://www.mm-log.com/lab-curves-gimp


License:

This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; version 3 of the License.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.

The GNU Public License is available at
http://www.gnu.org/copyleft/gpl.html

'''

from gimpfu import *
import subprocess
import os, sys

def plugin_main(image, drawable, visible):
  pdb.gimp_image_undo_group_start(image)
 
  # Copy so the save operations doesn't affect the original
  if visible == 0:
    # Save in temporary.  Note: empty user entered file name
    temp = pdb.gimp_image_get_active_drawable(image)
  else:
    # Get the current visible
    temp = pdb.gimp_layer_new_from_visible(image, image, "Visible")
    image.add_layer(temp, 0)

  buffer = pdb.gimp_edit_named_copy(temp, "DeepPaintShellTemp")

  #save selection if one exists
  hassel = pdb.gimp_selection_is_empty(image) == 0
  if hassel:
    savedsel = pdb.gimp_selection_save(image)
   
  tempimage = pdb.gimp_edit_named_paste_as_new(buffer)
  pdb.gimp_buffer_delete(buffer)
  if not tempimage:
    raise RuntimeError
  pdb.gimp_image_undo_disable(tempimage)

  tempdrawable = pdb.gimp_image_get_active_layer(tempimage)

  # 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("png")
  #tempfilename = "C:\\Temp\\tempfile.png"
 

  # !!! Note no run-mode first parameter, and user entered filename is empty string
  pdb.gimp_progress_set_text ("Saving a copy")
  pdb.file_png_save_defaults(tempimage, tempdrawable, tempfilename, tempfilename)

  # Command line
  path = "c:\\PF\\DeepPaint\\"
  command = path + "deeppaint.exe " + "\"" + tempfilename + "\""

  # Invoke external command
  pdb.gimp_progress_set_text ("run DeepPaint...")
  pdb.gimp_progress_pulse()
  child = subprocess.Popen(command, shell=True)
  child.communicate()

  # put it as a new layer in the opened image
  try:
    newlayer2 = pdb.gimp_file_load_layer(tempimage, tempfilename)
  except:
    RuntimeError
  tempimage.add_layer(newlayer2,-1)
  buffer = pdb.gimp_edit_named_copy(newlayer2, "DeepPaintShellTemp")

  if visible == 0:
    sel = pdb.gimp_edit_named_paste(drawable, buffer, 1)
  else:
    sel = pdb.gimp_edit_named_paste(temp, buffer, 1)
   
  pdb.gimp_buffer_delete(buffer)
  pdb.gimp_floating_sel_anchor(sel)

  #load up old selection
  if hassel:
    pdb.gimp_selection_load(savedsel)
    image.remove_channel(savedsel)
 
  # cleanup
  os.remove(tempfilename)  # delete the temporary file
  gimp.delete(tempimage)   # delete the temporary image

  # Note the new image is dirty in Gimp and the user will be asked to save before closing.
  pdb.gimp_image_undo_group_end(image)
  gimp.displays_flush()


register(
        "python_fu_deeppaintshell",
        "Call Deep Paint",
        "Call Deep Paint",
        "Rob Antonishen",
        "Copyright 2011 Rob Antonishen",
        "2011",
        "<Image>/Filters/Deep Paint...",
        "RGB*, GRAY*",
        [ (PF_RADIO, "visible", "Layer:", 1, (("new from visible", 1),("current layer",0)))
        ],
        [],
        plugin_main,
        )

main()


I believe it will work with any program you want to call.This should be thrown into the master with a setup list of dif programs to call.
All i did was copy the Deep Paint directory to the PF directory in C directory.
Rename it to DeepPaint (no spaces)
Altered the code to above and tried it...worked excellent!

I used them both together no problems.
I love it - i don't think we need PSPI anymore. Ill keep it though. =P
No need for the ps path though.

_________________
Image
Gimp Rocks Blog
Simply Gimp Tutorials
"Once your in the cloud, you're in the net"
____________
OK, . . . . so what's the speed of dark?


Top
 Profile  
 
 Post subject: Re: XNViewShell
PostPosted: Sat Jan 08, 2011 7:43 am  (#40) 
Offline
Global Moderator
User avatar

Joined: May 16, 2010
Posts: 9027
Location: "Looking for my eraser" =P
Rob would it be possible to use this to call say just one 8bf filter?
Like say i want to call just my Alien Skin filters.
Could i throw them into PF and call them from there or would it need to be an exe?
I was thinking maybe change this line
# Command line
path = "c:\\PF\\DeepPaint\\"
command = path + "deeppaint.exe " + "\"" + tempfilename + "\""

to

# Command line
path = "c:\\PF\\AlienskinProgramNameHere\\"
command = path + "alienskinpluginnamehere.8bf " + "\"" + tempfilename + "\""

Would that work?
That would be cool!

I guess what i am asking is, can you call any extension with this Python file?

_________________
Image
Gimp Rocks Blog
Simply Gimp Tutorials
"Once your in the cloud, you're in the net"
____________
OK, . . . . so what's the speed of dark?


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 268 posts ]  Go to page Previous  1, 2, 3, 4, 5, 6, 7 ... 27  Next

All times are UTC - 5 hours [ DST ]


Who is online

Users browsing this forum: Odinbc and 4 guests


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 post attachments in this forum

Search for:
Jump to:  

* Login   * Subscribe to RSS Feed


Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group