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
Unofficial Python implementation of the DNMF overlapping community detection algorithm

DNMF Unofficial Python implementation of the Discrete Non-negative Matrix Factorization (DNMF) overlapping community detection algorithm Paper Ye, Fan

Andrej Janchevski 3 Nov 30, 2021
A web interface for a soft serve Git server.

Soft Serve monitor Soft Sevre is a very nice git server. It offers a really nice TUI to browse the repositories on the server. Unfortunately, it does

Maxime Bouillot 5 Apr 26, 2022
create cohort visualizations for a subscription business

pycohort The main revenue generator for subscription businesses is recurring payments. There might be additional one-time offerings but the number of

Yalim Demirkesen 4 Sep 09, 2022
Cylc: a workflow engine for cycling systems

Cylc: a workflow engine for cycling systems. Repository master branch: core meta-scheduler component of cylc-8 (in development); Repository 7.8.x branch: full cylc-7 system.

The Cylc Workflow Engine 205 Dec 20, 2022
Run PD patches in NRT using Python

The files in this repository demonstrate how to use Pure Data (Pd) patches designed to run in Non-Real-Time mode to batch-process (synthesize, analyze, etc) sounds in series using Python.

Jose Henrique Padovani 3 Feb 08, 2022
Pytorch implementation of "Peer Loss Functions: Learning from Noisy Labels without Knowing Noise Rates"

Peer Loss functions This repository is the (Multi-Class & Deep Learning) Pytorch implementation of "Peer Loss Functions: Learning from Noisy Labels wi

Kushal Shingote 1 Feb 08, 2022
CEI Natural Disaster Tracking Portal

CEI Natural Disaster Tracking Portal (cc) Climatic Eye of ISCI We are an initiative that conducts studies in the field of Space Science, publishes pro

Baris Dincer 7 Dec 24, 2022
A dog facts python module

A dog facts python module

Fayas Noushad 3 Nov 28, 2021
Nuclei - Burp Extension allows to run nuclei scanner directly from burp and transforms json results into the issues

Nuclei - Burp Extension Simple extension that allows to run nuclei scanner directly from burp and transforms json results into the issues. Installatio

106 Dec 22, 2022
Find functions without canary check (or similar)

Ghidra Check Protector Which non-trivial functions don't reference the stack canary checker (or other, user-defined function)? Place your cursor to th

buherator 3 Jan 17, 2022
How did Covid affect businesses?

NYC_Business_Analysis How did Covid affect businesses? COVID's effect on NYC businesses We all know that businesses in NYC have been affected by COVID

AK 1 Jan 15, 2022
A simple program which gets a file(CSV/Excel) with tasks and creates different variants

TestMakerProject A simple program which gets a file(CSV/Excel) with tasks and creates different variants The main program is QTengine.py You only have

George 3 Nov 18, 2021
Python-Course-V1 - This Repo contains a series of Python Jupyter Notebooks and assignments

This Repo contains a series of Python Jupyter Notebooks and assignments. The assignments are taken from Python Crash Course book by Eric Matthes.

2 Nov 15, 2022
Anti VirusTotal written in Python.

How it works Most of the anti-viruses on VirusToal uses sandboxes or vms to scan and detect malicious activity. The code checks to see if the devices

cliphd 3 Dec 26, 2021
Bots in moderation and a game (for now)

Tutorial: come far funzionare il bot e durarlo per 24/7 (o quasi...) Ci sono 17 passi per seguire: Andare sul sito Replit https://replit.com/ Vedrete

ZacyKing 1 Dec 27, 2021
A VirtualBox manager with interactive mode

A VirtualBox manager with interactive mode

Luis Gerardo 1 Nov 21, 2021
Repositório para estudo do airflow

airflow-101 Repositório para estudo do airflow Docker criado baseado no tutorial Exemplo de API da pokeapi Para executar clone o repo execute as confi

Gabriel (Gabu) Bellon 1 Nov 23, 2021
A tutorial presents several practical examples of how to build DAGs in Apache Airflow

Apache Airflow - Python Brasil 2021 Este tutorial apresenta vários exemplos práticos de como construir DAGs no Apache Airflow. Background Apache Airfl

Jusbrasil 14 Jun 03, 2022
プレヤフHackUチーム「キャット・タン」が作成したアプリ「illustection」

cat_tongue_illustection プレヤフHackUチーム「キャット・タン」が作成した, プライバシー保護アプリ「illustection」です! デモ動画 https://youtu.be/z3I7LuB_i58 機能 アップロードされた画像をいい感じのイラストやの素材に置き換える(

4 Jul 03, 2021
Scraper pour les offres de stage Tesla et les notes sur Oasis (Polytech Paris-Saclay) sous forme de bot Discord

Scraper pour les offres de stage Tesla et les notes sur Oasis (Polytech Paris-Saclay) sous forme de bot Discord

Alexandre Malfreyt 1 Jan 21, 2022