A programming language that for tech savvy graphic designers

Related tags

MiscellaneousPhoTex
Overview

Microsoft Hackathon - PhoTex

Idea

A programming language that allows tech savvy graphic designers develop scalable vector graphics using plain text code. The designer can create a canvas and declare various elements that are to be rendered on that canvas. They can also define and name custom fonts, colors, and complex objects that can be reused in their project.

A video we made about the project containing more information and a coding tutorial: https://www.youtube.com/watch?v=-G7Mk0YNnjw

The designer’s code (stored in a .ptex file) is interpretted by PhoTeX and an SVG representation of their design is generated. The resulting image can be outputted in many common image file formats.

Inspiration

There does not exist a good universal text-based tool for creating general purpose vector and raster graphics. Almost all existing tools are GUI-based visual editors and thus have several limitations that could be overcome by using a WYSIWYM approach. For example, in GUI-based tools like Photoshop and Illustrator, it can be a lot of work to bring in assets you have created for other projects that you wish to name, reuse, and customize.

We were inspired by visualization and formatting tools such as LaTeX, Graphviz, Markdown and ORG. Our goal is to build a similar style tool, but with less steep of a learning curve. It will be purpose built to create highly customizable graphics that export to any format. Moreover, we want to build a system that automates some aspects of graphic design that Photoshop and other visual tools cannot.

How It Works

We decided to break the problem into two parts, the parser and the exporter. The parser will read in the plain text .ptex file into an abstract syntax tree and check the semantics of the user’s program. This approach will allow us to deliver the user meaninful error messages in the cases of synactic and semantic errors. If the parser doesn’t find any semantic or syntax errors it will pass a compiled hierarchy of graphical elements (shapes, images, text, etc.) to the exporter. The exporter will convert the parse tree into a set of hierarchically grouped primitive objects which can then be easily be converted to SVG format. Lastly, the exporter will convert the resulting svg into the final file output type (.png, .jpg, .svg, etc).

We are currently using the Lark parser (https://github.com/lark-parser/lark). Lark is an open-source python library that enables us to build our abstract syntax trees based on an EBNF-like context-free grammar. To assist in building and exporting SVG files, we are using SVGLib (https://github.com/deeplook/svglib).

Getting Started

  1. If you haven’t already, install Python 3.x.x (https://www.python.org/)
  2. Open a terminal window and navigate to the project root
  3. [Optional] Create a new virtual environment
  4. Run pip -r requirements.txt in the terminal to acquire all pip dependencies
  5. Navigate to the src folder
  6. Create a .ptex file and write your code!
  7. Build your code by running python photex.py [YOUR_FILE_NAME].ptex
  8. If there were no errors, your output files should be located in the same folder as your code
Owner
Joe Furfaro
AGV Software Developer @ Martinrea | Lead Developer @ eatDipole
Joe Furfaro
PatZilla is a modular patent information research platform and data integration toolkit with a modern user interface and access to multiple data sources.

PatZilla is a modular patent information research platform and data integration toolkit with a modern user interface and access to multiple data sources.

IP Tools 68 Dec 14, 2022
Defichain maxi - Scripts to optimize performance on defichain rewards

defichain_maxi This script is made to optimize your defichain vault rewards by m

kuegi 75 Dec 31, 2022
An addin for Autodesk Fusion 360 that lets you view your design in a Looking Glass Portrait 3D display

An addin for Autodesk Fusion 360 that lets you view your design in a Looking Glass Portrait 3D display

Brian Peiris 12 Nov 02, 2022
Biohacking con Python honeycon21

biohacking-honeycon21 This repository includes the slides of the public presentation 'Biohacking con Python' in the Hack&Beers of HoneyCON21 (PPTX and

3 Nov 13, 2021
Block when attacker want to bypass the limit of request

Block when attacker want to bypass the limit of request

iFanpS 1 Dec 01, 2021
The ROS publisher/subscriber example packaged as a snap

publisher-subscriber The ROS publisher/subscriber example packaged as a snap, based on ROS Noetic and Ubuntu Core 20. Strictly confined. This example

3 Dec 03, 2021
A simple script for generating screenshots with Vapoursynth

Vapoursynth-Screenshots A simple script for generating screenshots with Vapoursynth. About I'm lazy, and hate changing variables for each batch of scr

7 Dec 31, 2022
Python library for creating and parsing HSReplay XML files

python-hsreplay A python module for HSReplay support. https://hearthsim.info/hsreplay/ Installation The library is available on PyPI. pip install hsre

HearthSim 45 Mar 28, 2022
A Python application that simulates the rolling of a dice, randomly picking one of the 6 faces and then displaying it.

dice-roller-app This is an application developed in Python that shuffles between the 6 faces of a dice, using buttons to shuffle and close the applica

Paddy Costelloe 0 Jul 20, 2021
Analyzes crypto candles over a set time period and then trades based on winning patterns found

patternstrade Analyzes crypto candles over a set time period and then trades based on winning patterns found. Heavily customizable. Warning: This was

ConnorCreate 14 May 29, 2022
Python PID Controller and Process Simulator (FOPDT) with GUI.

PythonPID_Simulator Python PID Controller and Process Simulator (FOPDT) with GUI. Run the File. Then select Model Values and Tune PID.. Hit Refresh to

19 Oct 14, 2022
This repository containing cross-section cut and fill calculations using Python programming language.

cross-section This repository is containing cut and fill calculations for cross-section using Python programming language. This codes is made to calcu

3 Jun 15, 2022
Runtime Type Checking in Python 3

typo This package intends to provide run-time type checking for functions annotated with argument type hints (standard library typing module in Python

Ivan Smirnov 26 Dec 13, 2022
Vehicle Identification Speed Detection (VISD) extracts vehicle information like License Plate number, Manufacturer and colour from a video and provides this data in the form of a CSV file

Vehicle Identification Speed Detection (VISD) extracts vehicle information like License Plate number, Manufacturer and colour from a video and provides this data in the form of a CSV file. VISD can a

6 Feb 22, 2022
Anki for desktop computers

Anki This repo contains the source code for the computer version of Anki. If you'd like to try development builds of Anki but don't feel comfortable b

Ankitects 12.9k Jan 09, 2023
A domonic-like wrapper around selectolax

A domonic-like wrapper around selectolax

byteface 3 Jun 23, 2022
Cloud-native SIEM for intelligent security analytics for your entire enterprise.

Microsoft Sentinel Welcome to the Microsoft Sentinel repository! This repository contains out of the box detections, exploration queries, hunting quer

Microsoft Azure 2.9k Jan 02, 2023
Code and yara rules to detect and analyze Cobalt Strike

Cobalt Strike Resources This repository contains: analyze.py: a script to analyze a Cobalt Strike beacon (python analyze.py BEACON) extract.py; extrac

Tek 224 Jan 04, 2023
A Python package for searching journal publications and researchers

scholarpy A python package for searching journal publications and researchers Free software: MIT license Documentation: https://giswqs.github.io/schol

Qiusheng Wu 8 Mar 12, 2022
Strong Typing in Python with Decorators

typy Strong Typing in Python with Decorators Description This light-weight library provides decorators that can be used to implement strongly-typed be

Ekin 0 Feb 06, 2022