[Home]
Table of contents
I love programming. I use my programming knowledge mostly to create tools for myself. I am sharing them here with the hope
that they might prove useful for others as well. However, I harbour grave doubt that they will. Casual programming style,
absolutely no documentation and non-trivial functionality do not enhance user friendliness of a software.
A rather wierd piece of software that I wrote for colouring
scanned sketches. The input is a BW image (not greylevel, but
pure BW). The software allows me to identify and colour the
connected regions (called flats by artists). Of course, any decent graphics software (like
GIMP/Krita) has provision for this using the
Flood Fill algorithm. But the problem with scanned images is that
the lines often have little gaps in them. It is very difficult
and time-consuming to detect all such gaps in a complex
sketch. And then it is hard to remove the gaps, as this means
switching colours and pens. This software is written to
solve this problem. It starts out with simple Flood Fill. But if
the colour spills out, then it asks the user to click somewhere
on the spill over area, and shows a path to that point.
The path must pass through at least one gap, and so
following the path visually detects at least one gap. Then the
software allows me to draw a one-pixel wide line to bridge the
gap.
I use this editor to write my books. Developed over many years, it is more like a
Swiss army knife than an editor. It is a weird combination of features!
It lacks any text replace facility, but can play audio! If you want to try it out just download
the jar file. If you want to understand how it works, then the
starting point is Finalise.java.
Recently I came across a number of youtube videos showing how one can make a super cheap graphics pen that can be used with
a laptop trackpad. I made one, and then improved the design a bit. It is super simple:
Take a ball point pen. Throw away the refill. Crumple some paper into a tight ball with
thickness of a finger. Place the ball at the tip of the pen, and wrap the ball with the pen in
aluminium foil. Then hold the pen so that you finger touches the aluminium foil. Press down upon
the laptop trackpad with the aluminium-clad paper-ball, and write or draw! That's it!
However, it was still not
practically useable with
standard graphics softwares (like GIMP or Inkscape). So I wrote a little program to go with my graphics pen.
Real graphics pens provide three functionalities that is not possible with the pen I made:
-
Pressure sensitivity
- Absolute positioning
- Buttons on the pen to distinguish moving and dragging.
Out of these I do not care about pressure sensitivity (I am not a good artist, so I do not even
know how to use pressure sensitivity to my advantage). But I miss absolute positioning.
Also a graphics pen controls the same pointer that we usually control with the mouse. So not all motions are used for making
marks. We also need motion to position the pen. Most softwares use dragging (ie holding the left
buttun down) while drawing. This seriously impairs the fluidity of the hand's motion while
drawing. Graphics pens avoid this (to some extent) by providing the drag button right on the pen, so that you can press
it while holding the pen. I needed some way to avoid the same problem with my pen.
The most important feature is surprisingly simple. Hit the "End" key once to signal that you want to draw. Aft that the mouse
motion will be interpreted as dragging (no need to hold anything down). If you pause for more than 1 sec, the software will
interpret that as the end of the current drawing.
You can save the scribbles as SVG. I generally load the SVG in Inkscape and perform "Simplify path" a few times to get decent
organic curves. Then a little bit of touching up with the Point tool of Inkscape produces the desired effect.
The software also allows loading a background image to act as a guide. This image is taken directly from the system clipboard.
So taking a screenshot and just copying it (without saving it to some file) I can instantly load it into an existing session
of GPen.
OCR-ing handwriting is a challengling problem. I turned the
problem upside down, and designed an OCR-able
handwriting font. It is basically a set of 64 symbols and a
piece of software. The symbols
may be scribbled fast, and yet can be robustly detected from a
scanned image using the software program. The 64 symbols may be
mapped appropriately to the alphabet of some language of the
user's choice. The current version maps them to Bengali and
English.
A convenient commandline wrapper over MLT. Also a camera
matcher. See here.
A simple flex-bison based Linux software (can run on android
termux) for account keeping. See here.
I have written a 3d software that starts
from 3d vector representation and produces 2d vector representation.