PETRONODE

4.3. Clipping Techlog plots

Depending on the size of the well, Techlog tends to leave blank space at the bottom of the log plots.

The following utility is provided to crop the plots from top and bottom for use on montages. Besides the plot cropping, it is a convenient way to extract log inserts and other such graphics from plots.

Utility Petronode.ClipImage.exe. Crops predefined number of pixels from the top, then removes the blank space from the image bottom. The blank space is defined as all pixels in the row being brighter than (R>200 and G>200 and B>200).


Command line application:

Clip_Image.exe input_file output_file /s= /g= /c

    input_file - file to process

    output_file (optional) - file to write to. It omitted, the input file is overwritten

    /s=0 (optional) - number of pixels to skip from the top

    /g=0 (optional) - minimum number of pixels to get from the top

    /c (optional) - clip empty pixels from the bottom


The following Python script evokes the Clip_Image.exe (can be used inside or outside Techlog)

#

# Example 11 - clipping a log file

#

import os

import subprocess

#

# location of Petronode install folder

#

cBatchProcessorFolder = "C:\\Program Files\\Petronode"

#

# clips an image:

# skips topPixel from the top

# includes getPixels as minimum

# clips white pixels from the bottom

#

def Clip_Image_File ( workfolder, input, output="", topPixel=0, getPixels=0, clipBottom = True):

    Params = [os.path.join( cBatchProcessorFolder, "Petronode.ClipImage.exe")]

    Params += [ os.path.join( workfolder, input)]

    if output != "" : Params += [ os.path.join( workfolder, output)]

    if topPixel > 0 : Params += [ "/s=" + str(topPixel)]

    if getPixels > 0 : Params += [ "/g=" + str(getPixels)]

    if clipBottom: Params += [ "/c"]

    subprocess.call( Params)

#

# Clip test image to the rectangle

#

Clip_Image_File ( ".", "Test.png", "Test_out.png", 10)


The source image is like this:

Example_11











The resulting image is like this:

Example_01_outout