PETRONODE

4.4. Making Blank Images

Sometimes it may be useful to create a blank image (placeholder) from a Python script.

Utility Petronode.BlankImage.exe. Creates a blank image in defined format.

The following formats are supported: png, tiff, jpg, bmp, emf, gif, wmf.


Command line application:

    Blank_Image.exe output_file X Y

        output_file - file to write to. It exists, the file is overwritten.

        X - number of pixels, image width.

        Y - number of pixels, image height.


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

    #

    # Example 12 - creating a blank graphics file

    #

    import os

    import subprocess

    

    #

    # location of Petronode install folder

    #

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

    

    #

    # Makes blank image in workfolder, with name output, size (X x Y)

    #

    def Make_Blank_Image ( workfolder, output, X, Y):

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

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

        Params += [ str(X)]

        Params += [ str(Y)]

        return subprocess.call( Params)

    

    Make_Blank_Image( ".", "Test.gif", 100, 100)