It is currently 17 Dec 2017, 23:10

GIMP Python Fu ScriptsScale bar and automate script for GIMP (for Morphéus2) (Showcase | Slideshow)

Share your Python Fu scripts for GIMP here
User avatar
tim

Administrator
View: Showcase | Slideshow
Topic Posts: 9/15
Posts: 2000
Joined: 25 Sep 2016, 17:16
Cash on hand: 6,288.73 GLP
Bank: 41,331.25 GLP
Gender: Guy
Location: Victoria, BC
Website: https://gimplearn.net
Operating System: Windows
GIMP Version: 2.8.22
My Personal Blog
My FineArtAmerica
x 1006
x 217
Contact:
Canada

Scale bar and automate script for GIMP (for Morphéus2)

Post#1 by tim » 01 Nov 2016, 12:03


This script was requested by Morphéus2.
:download:
morpheus_automate.zip #
2 zipped .py files (unzip, put in your GIMP's /plug-ins/ folder)
(4.03 KiB) Downloaded 39 times
:download:
morpheus_automate (2).zip #
version 2 - 1 zipped .py file (unzip, put in your GIMP's /plug-ins/ folder)
(2.01 KiB) Downloaded 34 times
:download:
morpheus_automate (3).zip #
version 3 - fixed Y placement calculation bug
(2.04 KiB) Downloaded 36 times
:download:
morpheus_automate (4).zip #
version 4 - open .tiff files as well as .tif files
(2.06 KiB) Downloaded 44 times
:download:
morpheus_automate (5).zip #
version 5 - flatten image (mutiple layers down to one layer) after opening file.
(2.1 KiB) Downloaded 40 times
:download:
morpheus_automate (6).zip #
version 6 - 2 zipped .py files. (Custom code change to match professor's image in aspect ratio and where scale font shows)
(4.35 KiB) Downloaded 21 times
:download:
morpheus_automate (7).zip #
version 7 - set font to "Times New Roman," and added space between number and unit(cm)
(4.36 KiB) Downloaded 34 times
Menu Location: Python Fu -> Morpheus Automate.

Instructions.
0. Unzip 2 .py files and put in your GIMP's /plug-ins/ folder. Then restart GIMP.

1. Open the first .tif file you want to work with in GIMP, make sure the layer name is the same as the .tif file name that you just opened. The script will use this layername to open the next .tif file in alphabetical order.

2. Measure 1 cm record the number of pixels (A).

3. Select area you want to crop down to.

4. Run Script.
Select Input folder (where next .tif file can be found).
Select .tif output folder.
Select .jpg output folder.
Enter number of pixels for 1cm (A).
Then OK to run script.

5. Script will perform all the necessary steps like cropping, change resolution, exporting to .tif and add scale bar, then export .jpg files. Then script will open the next .tif file for you to start at step 2 again.
You can just close the previous file that script is done.
0 x



aka Tin
Image gimplearn.net                                              

Registered members enjoy ads-free content
No avatar
Morphéus2
Forum Member
View: Showcase | Slideshow
Topic Posts: 6/15
Posts: 8
Joined: 01 Nov 2016, 09:11
Cash on hand: 50.00 GLP
Gimp Nation

Post#2 by Morphéus2 » 01 Nov 2016, 14:46


Impressive, you did an amazing job! Thank you very much.

one or two details:
For the files's location I can select the disc C or D but I can not go further to choose the folders themselves.
Is it possible that I can choose the color of the bar (black or white), some photos are very clear?
0 x




User avatar
tim

Administrator
View: Showcase | Slideshow
Topic Posts: 9/15
Posts: 2000
Joined: 25 Sep 2016, 17:16
Cash on hand: 6,288.73 GLP
Bank: 41,331.25 GLP
Gender: Guy
Location: Victoria, BC
Website: https://gimplearn.net
Operating System: Windows
GIMP Version: 2.8.22
My Personal Blog
My FineArtAmerica
x 1006
x 217
Contact:
Canada

Post#3 by tim » 01 Nov 2016, 14:55


when you choose folder, you can choose Other...at the very bottom and it'll let you browse to subfolders.
I'll upload a version 2 with color of bar option.

PS: Do you want to select one color, and then it'll use that same color for the bar and the font color as well?

How about i let you choose a color, and then use that color for bar and font color, and all the other colors will just be inverted color of selected color.
so when you choose black, you'll get black bar and font, and the font shadow and other color will just be inverted of black which is white. and vice versa.

PS: Please give version 2 (posted in the first post) a try and let me know if that works for you.
0 x



aka Tin
Image gimplearn.net                                              

No avatar
Morphéus2
Forum Member
View: Showcase | Slideshow
Topic Posts: 6/15
Posts: 8
Joined: 01 Nov 2016, 09:11
Cash on hand: 50.00 GLP
Gimp Nation

Post#4 by Morphéus2 » 01 Nov 2016, 16:35


I test it a little bit and I faced a problem:

The source files I Use are sometimes .TIF and sometime .tiff. It means that when we oppen a .TIF it it's necessary to select the first image to be the layer.
Image
When your script open a file the result is that:
Image

On one of my test it cut the low part of the image:
Image

EDIT: the script work well on .tiff files but when it open the next file, it search for the next .TIF and ignor other .tiff
0 x




User avatar
tim

Administrator
View: Showcase | Slideshow
Topic Posts: 9/15
Posts: 2000
Joined: 25 Sep 2016, 17:16
Cash on hand: 6,288.73 GLP
Bank: 41,331.25 GLP
Gender: Guy
Location: Victoria, BC
Website: https://gimplearn.net
Operating System: Windows
GIMP Version: 2.8.22
My Personal Blog
My FineArtAmerica
x 1006
x 217
Contact:
Canada

Post#5 by tim » 01 Nov 2016, 17:01


And try version 3 for Y-placement bug fix.

Version 4 will open .tiff files as well as .tif files
0 x



aka Tin
Image gimplearn.net                                              

No avatar
Morphéus2
Forum Member
View: Showcase | Slideshow
Topic Posts: 6/15
Posts: 8
Joined: 01 Nov 2016, 09:11
Cash on hand: 50.00 GLP
Gimp Nation

Post#6 by Morphéus2 » 02 Nov 2016, 05:59


We are almost done. I can not thank you enough for what you are doing.

.TIF files still dont work: When the script open them there is two layers:
Image
1) one called "arrière-plan" (backgroud) with the image
2) a second layer called by the file name with a tiny image on the top left
The script don't work on this config:
Image

When I open manualy a .TIF with gimp he ask me that:
Image
if I "select all" (the two page) it open the same way as your script. If I just want one layer with the file name that work with your script I must select only "page 1"
0 x




User avatar
tim

Administrator
View: Showcase | Slideshow
Topic Posts: 9/15
Posts: 2000
Joined: 25 Sep 2016, 17:16
Cash on hand: 6,288.73 GLP
Bank: 41,331.25 GLP
Gender: Guy
Location: Victoria, BC
Website: https://gimplearn.net
Operating System: Windows
GIMP Version: 2.8.22
My Personal Blog
My FineArtAmerica
x 1006
x 217
Contact:
Canada

Post#7 by tim » 02 Nov 2016, 08:29


can you attached one of these TIF files that opens and has 2 pages so i can see what it looks like
0 x



aka Tin
Image gimplearn.net                                              

Post Reply

Last 20 Members Who Visited This Topic

User avatar gnerd (1), User avatar animicule (4)

  • Similar Topics
    Replies
    Views
    Last post
• Featuring Members' Works (Image Attachments Only) •
1: tim
2: gnerd
3: Issabella
4: tim
5: oldmangrumpy
6: RJKD
7: Pat625

Who is online

Users browsing this forum: No registered users and 2 guests