Welcome, Guest |
You have to register before you can post on our site.
|
|
|
Python Out of Sequence? |
Posted by: Kjaamor - 09-22-2023, 04:31 PM - Forum: Scripting questions
- Replies (2)
|
 |
I wrote a python script that removes a background colour from an image, orientates the remainder, resizes the image and then overwrites the existing image file. All of the functions work as expected...but they don't happen in the order expected. The final two lines (below) happen in reverse order.
Quote: pdb.gimp_image_resize(imageToBeResized, 900, 1500, widthoffset, heightoffset)
pdb.gimp_file_save(imageToBeResized, drawable, imageFileName, imageFileName)
So the image will overwrite before being resized, and I have no idea why this is the case.
- Running the second line twice makes no difference - it will continue to overwrite without resizing.
- Duplicating both lines (1,2,1,2) actually shifts the affected area so that it saves in 900*1500 but to the image focus' upper left.
Anyone have any idea why this would be?
Full code below for reference:
Quote:def postmatch_resize(image):
imageFileName = pdb.gimp_image_get_filename(image)
imageToBeResized = gimp.image_list()[0]
drawable = pdb.gimp_image_active_drawable(imageToBeResized)
pdb.gimp_image_crop(imageToBeResized, 1900, 1500, 0, 0)
colorToDelete1 = gimpcolor.RGB(9, 246, 57)
colorToDelete2 = gimpcolor.RGB(6, 185, 42)
colorToDelete3 = gimpcolor.RGB(7, 216, 50)
colorToDelete4 = gimpcolor.RGB(4, 123, 28)
colorToDelete5 = gimpcolor.RGB(5, 154, 35)
colorToDelete6 = gimpcolor.RGB(3, 93, 21)
colorToDelete7 = gimpcolor.RGB(2, 62, 14)
pdb.gimp_image_select_color(imageToBeResized, 0, drawable, colorToDelete1)
if pdb.gimp_selection_is_empty(imageToBeResized) == False:
pdb.gimp_edit_clear(drawable)
pdb.gimp_image_select_color(imageToBeResized, 0, drawable, colorToDelete2)
if pdb.gimp_selection_is_empty(imageToBeResized) == False:
pdb.gimp_edit_clear(drawable)
pdb.gimp_image_select_color(imageToBeResized, 0, drawable, colorToDelete3)
if pdb.gimp_selection_is_empty(imageToBeResized) == False:
pdb.gimp_edit_clear(drawable)
pdb.gimp_image_select_color(imageToBeResized, 0, drawable, colorToDelete4)
if pdb.gimp_selection_is_empty(imageToBeResized) == False:
pdb.gimp_edit_clear(drawable)
pdb.gimp_image_select_color(imageToBeResized, 0, drawable, colorToDelete5)
if pdb.gimp_selection_is_empty(imageToBeResized) == False:
pdb.gimp_edit_clear(drawable)
pdb.gimp_image_select_color(imageToBeResized, 0, drawable, colorToDelete6)
if pdb.gimp_selection_is_empty(imageToBeResized) == False:
pdb.gimp_edit_clear(drawable)
pdb.gimp_image_select_color(imageToBeResized, 0, drawable, colorToDelete7)
if pdb.gimp_selection_is_empty(imageToBeResized) == False:
pdb.gimp_edit_clear(drawable)
pdb.plug_in_autocrop(imageToBeResized, drawable)
preheight = pdb.gimp_image_height(imageToBeResized)
prewidth = pdb.gimp_image_width(imageToBeResized)
heightoffset = 1500 - preheight
widthoffset = (900 - prewidth)/2
pdb.gimp_image_resize(imageToBeResized, 900, 1500, widthoffset, heightoffset)
pdb.gimp_file_save(imageToBeResized, drawable, imageFileName, imageFileName)
I doubt very much that the above cobbled together solution is optimal so I'll take pointers but I'm also curious as to why it doesn't work sequentially? I thought that was the whole point.
|
|
|
Fill selected space with image |
Posted by: pathblazerphoto - 09-22-2023, 01:50 PM - Forum: General questions
- Replies (1)
|
 |
Hi All
So I have an image with a blank white space and a hand around it, I am selecting the white space and now want it to add an image into that white space, adjusting for perspective etc. Is this possible in gimp? I am aware of how to do it manually, was hoping of a quicker method
|
|
|
Photomerge Capability |
Posted by: Bernard46 - 09-22-2023, 08:18 AM - Forum: General questions
- Replies (2)
|
 |
There's a very useful function in Adobe Photoshop Elements called Photomerge - this allows you to scan a very large document in several images and then combine them into a single image by just opening each one in the program and choosing the Photomerge tool. There are variations in the tool like Exposure or Panorama - it is the Panorama one I'm particularly interested in. I haven't been able to find anything similar in function or simplicity in GIMP - can anyone tell me if a Photomerge function is available in GIMP please?
|
|
|
How do I change selection behaviors? |
Posted by: Greymalkin - 09-22-2023, 04:11 AM - Forum: General questions
- Replies (4)
|
 |
I'm currently using Gimp 2.14 on Windows 11. I am having trouble with the selection tool. This is a problem with all selection tools (rectangular, oval, cage, freehand, ect).
Old behavior (desired): Click selection tool. Select the area of the canvas you want. Work inside the area. Click outside of the selected area. The area is un-selected. To add to the selected area, hold + and select a second area. To remove from the selected area, hold - and select the area to un-select. If no area has been selected, you may work on the entire canvas.
New behavior (make it stop!): Click selection tool. Select the area of the canvas you want. Area remains selected until you un-select it manually. To un-select you hold - and select the area you want to have un-selected. Unless an area has been selected, no tools will work on the canvas. You must select the entire canvas to be able to work on the entire canvas. If the entire canvas has been selected, you must un-select the entire canvas manually to be able to select a small part of the canvas.
The new behavior has been a nightmare for my workflow. I am constantly being forced to zoom out and remove all selected areas manually. I also have to constantly reselect the entire canvas so I can get back to work on the bigger picture. It's tedious and very annoying.
How do I get the old behavior back?
|
|
|
perspective tool ? |
Posted by: voun - 09-21-2023, 08:28 AM - Forum: General questions
- Replies (6)
|
 |
Hi
i used to use in photoshop a tool which was able to transform a polygon with 4 sides to a rectangle. on ordre toi make perspective disappear. you juste select the 4 points if the polygon and then activate the function and you obtain a rectangle.
i no longer have photoshop and need this fonction.
does it exist in the
Gimp ?
thanks for your help !
|
|
|
Unified Transform Tool |
Posted by: sallyanne - 09-21-2023, 02:12 AM - Forum: General questions
- Replies (3)
|
 |
Is there a tutorial here on how this tool can be utilised. I am pretty sure I have seen it talked about on here. I know I could probably find one at You Tube but yours would be sufficient. Don't need to go to Davies Media for all my info.
|
|
|
Automate an action |
Posted by: Gypsie38 - 09-20-2023, 11:53 AM - Forum: Scripting questions
- No Replies
|
 |
Hi, I wish to automate an action that takes actually 6 click, to only 2 clicks , This is what I'm thinkinf of :
I click on a new "button" (I need your help to create it) that opens a setting windows. Then I can choose a kind of shape (circle/ellipse/square) to draw a shape on an image, then click on valid. The result is a blur added on the shape
(Instead of clicking on the shape button in the tool box, then select a zone on the image, then click on the Filters menu, then click on Blur, then click on Gaussian blur, then choose the level of blur, then valid.)
Thanks for your help (I don't know anything about programming!
|
|
|
How to make part of a texture Invisible or Fully Transparent in DDS files? |
Posted by: Reefus - 09-20-2023, 08:01 AM - Forum: General questions
- No Replies
|
 |
I've been searching for an answer to this for a few days now. Though none of the suggested methods seems to work.
I'm just editing a Diffuse map and want to clear a certain texture element so it appears invisible in-game. The frustrating thng is, no matter what I do to the selection nothing ever changes.
I've tried deleting, erasing, manipulating the layers, adding masks, adjusting transparency thresholds, but the texture is completely unphased by it.
To offer more context, it's a Diffuse.dds texture file which I've been editing successfully. It all works in-game, even the specularity. I just can't figure out how to make parts of the texture invisible or transparent.
The texture file already has an Alpha and only one layer, the Diffuse.dds. There also exists a Normal map for this object, which just looks like purple nonsense to me. I haven't done much experimenting with that file.
Anyone have an idea what is going on here?
|
|
|
Plugins for speed up texture creation |
Posted by: autobot - 09-17-2023, 07:42 PM - Forum: Extending the GIMP
- No Replies
|
 |
Do you know any useful GIMP plugins (or external software) that speed up texture creation for Blender?
Especially I mean: manual editing PBR textures.
There are some tools to do it in 3d, there are node based generators,
but I can't found anything to manually paint multiple images at once in 2D.
For example I set one brush to have: height 0.5 , roughness 0.1, metallic 1, and green color and, when I paint, all images will be painted with expected values. (or paint with different pbr textures)
I know there is InsaneBump plugin but it is for generate additional maps from image, not for editing.
Also I'm looking for something (GIMP plugin or external program) for packing PBR texture atlases.
Auto-packing is not necessary, Most important for me is ability to manually positioning many islands.
If there is nothing like this, maybe I inspire someone of GIMP developers with this idea :-)
|
|
|
|