Welcome, Guest
You have to register before you can post on our site.

Username
  

Password
  





Search Forums

(Advanced Search)

Forum Statistics
» Members: 5,989
» Latest member: jhmiii
» Forum threads: 7,400
» Forum posts: 40,298

Full Statistics

Latest Threads
Is there a way to use *.8...
Forum: Gimp 2.99 & Gimp 3.0
Last Post: dziadekles
1 hour ago
» Replies: 3
» Views: 96
Do I have to create a fl...
Forum: General questions
Last Post: blogsofwardotme
5 hours ago
» Replies: 2
» Views: 89
Automatic selection tool
Forum: General questions
Last Post: rich2005
10 hours ago
» Replies: 1
» Views: 73
Color fill into pasted la...
Forum: General questions
Last Post: RealGomer
11 hours ago
» Replies: 2
» Views: 172
RawTherapy to Gimp
Forum: General questions
Last Post: doiphoto
Yesterday, 12:11 PM
» Replies: 2
» Views: 102
Recent folders missing fr...
Forum: Gimp 2.99 & Gimp 3.0
Last Post: rich2005
Yesterday, 11:31 AM
» Replies: 1
» Views: 78
crop and straighten photo...
Forum: General questions
Last Post: denzjos
05-09-2025, 10:51 AM
» Replies: 6
» Views: 223
Arrow Script
Forum: Extending the GIMP
Last Post: Chris Thompson
05-08-2025, 07:48 PM
» Replies: 133
» Views: 169,077
ofn3-layer-tiles
Forum: Extending the GIMP
Last Post: karaxus
05-08-2025, 10:53 AM
» Replies: 7
» Views: 1,056
Slowing down
Forum: General questions
Last Post: rich2005
05-08-2025, 10:33 AM
» Replies: 2
» Views: 240

 
Video New camera text scan cleanup plugin
Posted by: udif - 02-12-2018, 01:13 AM - Forum: Extending the GIMP - Replies (2)

Hi,

I wrote a C based GIMP plugin to cleanup text scans done with a camera.
Some of these scans, esp. of books tend to have darker and lighter areas on the page , and these don't work well when you try to use a thresholding tool on your text.
The plugin I wrote find the background level dynamically for each small part of the picture, by dividng the picture into squares whose radius is the inner_level parameter. For each square, the average level is calculated on a square whose radius is the kernel_size parameter (and is larger than the inner_size). A histogram is made o all the pixel values within the kernel area, and the most popular one is assumed to be the background level.
The next darker histogram peak is assumed to be the text color, and any pixel brighter than the text brightness (plus the threshold adjust) is squashed to white.
The result is the original text in its original brightness, plus a full white background, suitable for printing.
I forgot to add that the filter first converts everything to grey scale.

The plugin is in: Gimp-clean-text-photos
(Sorry, binaries are windows-only (x86), but full source code is provided).

Demo picture taken from here:
https://pxhere.com/en/photo/745068

Original Photo

Using GIMP threshold tool :
You can easily see that even if you let part of the picture become black, some other section is still too bright.
No global threshold level across all the picture can separate all the text from the background.

Using my plugin (Using a kernel size of 40, inner size 3, and threshold ajust is -12).

Increasing the kernel size increases the are over which the averaging is made, You want it to be at least as large as the text rows height so that the dark letters will never become the majority pixels instead of the background.
Increasing the inner_size makes things faster since more pixels are calculated for each square,
Changing the threshold_asjust controls the offset from the 2nd histogram peak, effectively turning this to a brighness  control.

I used it to clean up hundreds of text scans done using a simple pocket camera of open books where some of the pages are darker or have shadows. The objective was to get pictures that have a white background duitable for printing on a B/W laser printer, without losing text clarity.

Hope you find this useful.

Print this item

  Trouble with vector input for polygon selection
Posted by: ss32 - 02-11-2018, 09:57 PM - Forum: Scripting questions - Replies (2)

I'm writing a plugin to call python-fu-heal-selection with inputs of the file and the points defining the polygon selection, but cannot get the polygon selection to work.  I have tried using the square polygon select and it works fine, but the generic polygon selection does not accept my input; what's wrong with my script?

Code:
(define
    (heal-select points point_count)
    
    (let*
        (
            (image         (car (gimp-file-load RUN-NONINTERACTIVE "tmp.jpg" "tmp.jpg")))
            (active-layer     (car (gimp-image-get-active-layer image)))            
        )                                            
        
        ;(gimp-image-select-rectangle     image CHANNEL-OP-ADD 122 67 138 81)    
        (set! active-layer (car (gimp-image-get-active-layer image)))    
        (define path-points (list->vector points))
        (gimp-image-select-polygon     image CHANNEL-OP-ADD point_count path-points)
        (python-fu-heal-selection     RUN-NONINTERACTIVE     
                                        image
                                        active-layer
                                        3
                                        0
                                        1)                                            
        (display points)
        (gimp-file-save RUN-NONINTERACTIVE image active-layer  "tmp2.jpg" "tmp2.jpg")
        (gimp-image-delete image)
    
    )
)

With the command line input:
Code:
gimp -i -b "(heal-select '(122. 67. 138. 67. 138. 81. 122. 81. 122. 67.) 5)" -b "(gimp-quit 0)"

I have tried removing '(define path-points (list->vector points))' and passed it the points as #(1 2 3  4) and still get an error message hinting at the fact that the polygon isn't closed or is empty.

Print this item

Photo Creating 4k Image; Advanced Options X/Y Resolution
Posted by: Artisflowing - 02-11-2018, 01:59 AM - Forum: General questions - Replies (3)

Hello everyone!

When you are creating a new image and specifying the size. In the advanced options if I want to make something at 4k resolution should I bump up the resolution in the advanced options?

   

Thanks in advance for the informationSmile

Print this item

  can't remove guide lines
Posted by: gib65 - 02-10-2018, 05:40 PM - Forum: General questions - Replies (6)

Hello,

I have a couple guide lines on my canvas that are misplaced and annoying me, but I can't seem to get rid of them:

[Image: guide lines.png]


From what I recall, I think I should be able to hover over them, and the mouse icon should turn into a grabby thing that indicates I can click and drag the guide lines over to the ruler where they will disappear, but it's not doing so. For example, if I'm on the pencil tool and I hover over the guide line, the icon remains the pencil tool. If I click on the guide line, I just create a mark like the pencil tool is supposed to do. Thus, I can't seem to get rid of them.

Do I need to activate a specific tool in order to grab them or make them disappear? Is there some other way of making them disappear? Am I remembering correctly (that the mouse icon should turn into a grabby thing) and my instance of Gimp is somehow corrupt?

Thanks.

Print this item

  Cropped Corners
Posted by: le_jank - 02-09-2018, 07:01 PM - Forum: General questions - Replies (15)

Hello everybody (: I am trying to create a selection and an image with square/rectangles with cropped corners. Something like this:

[Image: b22024fd055d321772943efafac45311--battle...-viper.jpg]

All I can find is how to make rounded corners, but that is not exactly what I need. Does anyone have a clue on how to achieve this?

Print this item

Question Importing Layer Changes Color
Posted by: mattig89ch - 02-09-2018, 04:38 PM - Forum: General questions - Replies (2)

Hello all,

First time here.  In truth, I don't do alot of image editing.  Dangit Jim, I'm a network tech not a graphic artist!

But I had an idea for a custom morale Badge, that I wanted to try and get made for me.  All the people who make said badges, wanted an image to base their printing/embroidering off of.

And thus here we are.  Right now, I managed to figure out how to get image 1's background to be transparent.  But, when I add it as a layer on top of image 2, image 1's colors change.

Is there a way to either re-color image 1 to its original colors?  Or a way to lock image 1's colors, so they don't change?

Thanks all!

Print this item

  Exported Image Black Background
Posted by: avalier - 02-08-2018, 09:01 PM - Forum: General questions - Replies (2)

When I export this image, it is on a transparent background in Gimp and the PNG has a black background? 

If I use Black Text, it cannot be seen on the PNG. 

So if I  send this off to a printer, there is no text, and will the black background be present which will mess up the printing because I need it to be Transparent.



Attached Files Thumbnail(s)
   
Print this item

  Export Finished Design
Posted by: avalier - 02-08-2018, 05:54 PM - Forum: General questions - Replies (3)

I have a finished design and want to export. However, I get a notification box that states;

[The given filename does not have any known file extension. 
Please enter a known file extension or select a file format from the file format list.]

See attached



Attached Files Thumbnail(s)
   
Print this item

  Stroke Path 3D Effect
Posted by: Espermaschine - 02-08-2018, 03:14 PM - Forum: General questions - Replies (16)

Gave this effect a try (theres also a similar (and clueless) tutorial by he-who-shall-not-be-named on youtube).

Now i need to clean up the effect, but im lost with the choice of ca. 3000 different G'MIC filters.....any ideas ?

XCF attached below.



Attached Files Thumbnail(s)
   

.gz   3D Brushstroke Effect.xcf.gz (Size: 476.07 KB / Downloads: 460)
Print this item

  Using Brightness-Contrast color tool in grayscale mode image
Posted by: Ambulation - 02-07-2018, 05:02 AM - Forum: General questions - Replies (2)

I've been working in an image set to grayscale mode. It's in preparation for a publication that will only accept images that are naturally grayscale in this mode (these are from a scanning electron microscope-all pixels assigned grey values only). I'm working in the most up to date version of GIMP-2.8.22 in Win7.

There are some layers in which I wish to make minor edits to the brightness and contrast, but the tool makes no visible change to the layer (which is in a layer group) I have selected. There are no changes in the preview mode or when i press OK. Is it possible this feature is not usuable in greyscale, but only RGB mode?

Print this item