This tool is designed to allow users to gather hand written characters,
(Or I guess, any connected mass)
In photos/scans/images and export them to an image library and database.
- Written with Python 2.7
and PyQt 4
A Character Database is built and can be used to convert typed text into seemingly hand written images.
You can save those pages to a Page Database or export them as PNG files!
(The Character and Page Database Files let you jump back in where you left off, allowing you to edit all the settings.)
Since I have an intended purpose for this tool, it currently looks for darker objects.
Like having ink that is darker than the paper it's on.
This is done by looking out pixel by pixel to see if it's under a user-settable brightness threshold.
In the future, I'd like to add OCR (Optical Character Recognition) functionality.
Since it supports having as many character variations as you'd like, they could be used as training material for the OCR.
But that will be some time from now... We all have lives to manage and things that distract us.
It's slow right now, optimizations are being worked on,
But I'm hoping to expand out toward OpenGL / C++ in the future.
(Especially for the OCR support)
Python and PyQt was just the easy route to start with.
** Since this is still in Beta, some aspects are in flux **
The only major changes I forsee is GUI layout and adding new features.
If you find any bugs or have any suggestions, feel free to contact me at--
Kevin@Metal-Asylum.Net
The tool is expecting a folder in its root with images ( jpg, jpeg, png, bmp )
These photos should be scans/photos you took of your handwriting/letters/characters
With the tool open, click Set Project Folder
, and select your folder.
The tool will then create three folders,
pxl_textBases_origImages
- Your scans/photos will be moved to this directorypxl_textCharacterOutput
- Your exported Characters will be stored here as PNG filespxl_pageBuilderOutput
- Your exported Pages will be stored here as PNG filesIf all went well, the tool should load up the first image it finds from pxl_textBases_origImages,
With a list of all your files on the top of the window
Character Entry Editor
(Right side) don't have this feature yet.Read Found Character Data
the Final Output
thumbnail will have 3 red lines on it. You can click near those red lines and drag to adjust the values without fudging around with the sliders.P
- Load a Project FolderT
- Sample Threshold Color; toggleS
- Select ModeA
- Set to Add BrushR
- Set to Remove BrushW
- Set Working Area; toggleC
- Crop to Work Area; toggleO
- Show Outline Only; toggle
Set Project Folder
- P
hotkey - Sets and Attempts to load existing dataReset Character Data
- Resets all currently selected character data (The green color after sampling)TextBase Image List
- List of all your images, Hide/Show ToggleHide/Show TextBase List
- Hide/Show visibility toggle for the TextBase Image ListSearching Threshold
- Value of brightness that searching stops at.
Sample Threshold by Color
- T
hotkey - Lets you select pixels to set the Searching Threshold
Modes
- [When Active image]
Select Area
- S
hotkey -Add Brush
- A
hotkey -Remove Brush
- R
hotkey -Add/Remove Brush Size
- Size of Add/Remove BrushesEdge Grow/Shrink
- Contract or Expand your character's edge per pixel
Set Working Area
/ Remove Work Area
- W
hotkey - Isolate an area of your TextBase Image to help speed up performance and make tools/brushes easier to use.
Remove Work Area
and turn blue, then click and drag in the TextBase area to draw a blue working area outline.Crop To Work Area
/ Exit Work Area Crop
- C
hotkey - To help speed up things further, you can view the Work Area by itself for faster feed back for Select
/Add
/Remove
Brushes.
Exit Work Area Crop
and turn blue.Exit Work Area on Reset
- Auto Exit Work Area Crop
Off
, if you Reset Character Data
, it will keep the TextBase Viewer in Crop mode.On
, it will exit Crop mode when you Reset Character Data
.Show Outline Only
/ Exit Outline Only
- O
hotkey - Sometimes the character found might have grabbed some junk, this will outline the found character
Read Found Character Data
- Load your character data.
Crop, Found Area, Alpha Thumbnails
- After running Read Found Character Data
thumbnails are generated to show aspects of the found character data.
Alpha
' refers to the transparency of the final image.Character Final Output Image
- This is what your final character looks like.
Finishe Character
Top/Bottom
- These side sliders add or remove bounding box's top or bottomLeft/Right Align
- The left/right most edge of the character, for spacing characters correctlyBase Line
- Where the character aligns vertically on the line, for TextBed and PagePreMultiply Scale
- The amount the character is multiplied before added to the line, for TextBed and PageAlpha Fade Reach
- Pixel distance from the edge to had a fade to transparentAlpha Contrast
- The % visibility of the Alpha Fade edge.Degree Rotation
- Rotate the character counter-clockwise or clockwise by Negative or Positive degrees, respectively.Finish Character
- Creates a new Character Entry in the side bar with all of your settings stored on the entry.
Current TextBase
- Thumbnail of the current TextBase image
Reset Character Data
in the TextBase ViewerFilter
- Display only specific characters here.
Character Entry List
- Clicking the Character in the Entry List will load the settings into the Character Settings
Load Text Image
- Load a background image into the TextBed
Reload Text
- Reload any changes made to characters or Text FieldInput Test Text
- Characters to display in the TextBed ViewerPull Capital Letters
- Loads all Capital letters into the Text FieldPull Lower Letters
- Loads all Lower Case letters into the Text FieldPull Numbers
- Loads all Numbers into the Text FieldPull Non-Alphanumeric
- Loads all non-letters and non-numbers into the Text FieldMissing Characters
- Any non-existent characters will show up here from your Input Text Text
Auto Update
- Any changes in Character Settings or Text Field will automatically show up when On
.Vertical Sliders
-
Character TextBed Display
- Output of the Text Field as your Writing
Load Page Data File
- Loads any previous Page Data written to diskLoad Page BG Image
- Load a background image into the Page Output viewer
Input Page Text
- The text you'd like to add to the page.
%ocl%
Page Indentation
; Left, Top, Right, Bottom - Page margins
Font Scale
- Global scale multiplier of characters as they are added into the pageFont Kerning
- Global kerning size in pixels, the distance between characters in the pageSpace Size
- Size of a 'space' in pixelsLine Height
- How spread apart each new line is in pixelsLine Indent
- Indentation distance of wrapped lines of textRandom Seed
- The random value used when picking each character.
Flip Text Output Horizontally
- Will flip the text on page horizontally, when On
Auto Update Page
- Any changes will rebuild the page, when On
Update Output Text to Writing
- Update the current page you are editingNew Empty Page Entry
- Creates a new empty Page Group, resetting you values
Set as New Page Entry
- Creates a new Page Group from your current settingsScale Exports to Power of 2
- Scales down the page image resolution to power of 2
Output Directory
- Directory to export your Page Images toWrite Page Data File
- Write out the Page Data File ONLY; projectName/pageListKey.pyExport All Page Data & Images
- Write out the Page Data File and all Page Images
Input Page Text
-%charName%
to output the character you desire
%str%
for a star symbol instead of just a multiply symbolCustom special characters not implimented yet,
Current supported special characters-
ocl
,ocr
,oll
,olr
,osl
,osr
,oal
,oar
,str
They can be set to what ever you'd like though
str
doesn't mean it needs to be a star.
%###%
to scale text; %50%
is 50 percent scale, %100%
to get back to normal
%align:position%
- the positions can be left
, center
, or right
** to align your text center then **
%align%`** to reset to left alignment.%align%
%a:position%
- Set alignment for current line only
\n
will reset the alignment to left
%offset:#,#%
- Offset characters in X,Y by pixels
%offset:10%
- Will offset the following text [0,10]%offset%
or %o%
%o:#,#%
- To set offset for the next character only
%absolute:#,#%
/ %abs:#,#%
- Absolute line position in X,Y by pixels
%abs:10%
- Will position the text line to [0,10]%offset%
or %o%
%abs:20%%a:center%
Will center align your line,
with Y position 20 pixels from top of page.
%smallCaps:1%
/ %sc:1%
- Turn lower case letters into small capitals.
Small Capital Scale
slider.%sc%
to exit from small capitals.
%rotate:degrees%
- Rotate characters in degrees for all following text.
%spaceSize:pixels%
- Line space size ixels is relative offset.
%spaceSize%
or %ss%
%ss:pixels%
- Set spaceSize for current line only
\n
will reset the spaceSize to current setting
%kern:pixels%
- Line character kerning in relative pixels offset.
%kern:-10%
- If kerning is 0, it will be -10%kern%
or %k%
%k:pixels%
- Set kerning for next character only
%lineHeight:pixels%
- pixels is relative offset
%lineHeight:-20%
- If line height is 70, it will be 50%lineHeight%
to clear offset.%lineHeight%
or %lh%
%lh:pixels%
- Set lineHeight pixels for current line only
\n
will reset the lineHeight to current setting
%seed:#%
- Set the seed random for following characters.
%seed:12.4%
to set a random value of 12.4%seed%
to reset to your set seed%s%
or %s:#%
- To set a random or specific seed for the next character only
will
and both 'l's are the same 'l'-wil%s%l
changes the second 'l' to a different variation
%opacity:percent%
- Percentage is 0-100
%opacity:50%
- The characters following will be at 50% opacity.%opacity%
or %op%
%op:percent%
- To set opacity for the next character only
Support for --
%align:right%%140%ALL KINDS%100% of stuff!%a%
%a:center%%60%Scale,%100%%opacity:50%Opacity,%op% %offset:-30,50%&%k:20%Offsets!%o%
%lh:60%Change line heights.
%lineHeight:30%Normal left align.
%align:center%Center align text.%a%
%align:right%Right align text.%align%%lh%
%a:center%%ss:70%Changing space sizes
%kern:35%%ss:30%%a:center%%lh:25%Kerning also!!%o%%k%
%lh:-25%
%a:center%- Edit current line only tags -
%lineHeight:30%%%ss:-50%a:position%%ss% to change alignment
%%ss:-50%ss:pixels%%ss% to change space size
%%ss:-50%lh:pixels%%ss% to change line height%lh%
%a:center%- Edit next character only tags - %lineHeight:30%%%ss:-50%k:#%%ss% to change kerning %lineHeight:30%%%ss:-50%o:#,#%%ss% to change offset %%ss:-50%op:percent%%ss% to change opacity %%ss:-50%s:pixels%%ss% to change character variation
#### Bottom Bar (After loading a Page BG Image)
* **`Page Group List`** - List of all your current work
* **`Per Group`** - Isolated group of pages built from one text input
* **`Name of Group`** - This is the prefix name to your pages
* *A Name of 'Info' will export the pages as 'Info_1', 'Info_2', etc...*
* **`Edit Pages`** - Load and set all of the settings for that Page Group for Editing
* **`Delete Pages`** - Deletes the ENTIRE Page Group
* **`Thumbnail`** - Small little view of whats going on on the page
##### <p align="right">[^ Top](#index)</p>
______________________________
## Thanks for checking out pxlTextGenerator!