Package: img2segy
A tool for converting images to SEG-Y files.Noteimg2segyis offered under an open source non-permissive license, the AGPL 3. Alternative
commercial license terms may be available from Sixty North AS, as is help on using or
extendingimg2segy. Only basic support and fixes are provided gratis.InstallationInstallimg2segyfrom the PyPI withpip:python -m pip install img2segyor if you have pipx and only want to run img2segy from the command line:pipx install img2segyBasic usageGiven an image file, such as amy_cross_section.pngcontaining a vertical cross-section provide
information about the location of the image in a text (TOML) file calledmy_cross_section.toml,
and run theimg2segy convertcommand, supplying the image filename. If the TOML file has the
same filename stem it will be discovered and used:img2segy convert my_cross_section.pngThe resulting SEG-Y file will be calledmy_cross_section.segy.Configuration file formatThe configuration file contains subsections which describe the position of the image in geographical
space, the coordinate reference system in use, and control over how the image should be represented
in SEG-Y:[position]
left.x = 527501
left.y = 4840781

right.x = 527326
right.y = 4829018

depth.top = 0
depth.bottom = 4300

[coordinate-reference-system]
map-projection = "WGS-84 UTM"
zone-id = 15
horizontal-units = "m"
vertical-units = "m"

[segy]
# encoding = "ASCII"
# byte-order = ">"
trace-position.use-source-coord-fields = true
trace-position.use-group-coord-fields = true
trace-position.use-cdp-coord-fields = true
trace-number.use-trace-number-field = true
trace-number.use-crossline-number-field = true

base-trace-number = 1Some of the fields, such asmap-projectionare ignored, but it’s wise to include them anyway so
that the date is more self-documenting and the meaning of the numbers is clear to others and your
future self.The[position]section contains information which locates the corners of the supplied image in
geographical space. Theleft.xandleft.yentries are the geographic eastings and northings
respectively of the left edge of the image. Similarly, theright.xandright.yentries are
the geographic eastings and northings respectively of the right edge of the image. Thedepth.topanddepth.bottomentries give the depths of the top and bottom edges of the image.The number of traces in the resulting SEG-Y file will be equal to the horizontal number of pixels
across the supplied image. The number of samples per trace will be equal to the vertical number of
pixels down the image. If you want a different number of traces or samples than that which
corresponds to the pixel dimensions of the image, you should pre-process the image using other tools
before converting to SEG-Y.The[[segy]]section specifies how the SEG-Y data will be written and controls which header
fields are used, and for what.The optionaltrace-positionentriestrace-position.use-source-coord-fields,trace-position.use-group-coord-fieldsandtrace-position.use-cdp-coord-fieldscontrol
whether the horizontal component of geographic position of the trace, as linearly interpolated
between the two end points of the image, it written into the corresponding trace-header fields.Thetrace-numberentriestrace-number.use-trace-number-fieldandtrace-number.use-crossline-number-fieldcontrol whether an integer trace number is written into
the corresponding trace-header fields. By default, the left-most column of pixels will be given
a trace-number of zero. You can control this by settingbase-trace-numberto some other value,
such as one. If you need trace numbering to start from the right edge of the image, you should flip
the image left-to-right before usingimg2segy.