CodingTrain / CodingTrain/Suggestion-Box

Cut shapes out of text by using an image as a cutting mask

Aperta
#1,727 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub
Lingua principale
Nessun dato sulla lingua
Stelle
570
Fork
85
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

Descrizione

Something like this:

Example image showing a skull shape cut out of text
(solarseven/Shutterstock.com)


Using Lorem Ipsum / random characters / the program's own source code / whatever you like, cut a shape out of the text using a monochrome image as a mask.

Drawing the text, converting it to an image, and using the mask image to cut out a shape would make it easy. So the challenge is... don't do that. If you look around the shape, you'll notice there are no partial characters, no letters that have been cut in half. It's not a simple cookie-cutter shape removing part of an image, it's as if the "masked" characters were never drawn.

I'm thinking maybe treat the mask image as a grid, with each cell being the dimensions of a character in a (monospaced) font, then you can determine whether a character at x, y should be drawn by examining the equivalent mask cell at x, y.

The more advanced challenge would then be to use a variable-width font, as in the image.

Now I'm off to try this myself for giggles.

Guida per i contributori

Nessuna guida per i contributori indicizzata per questo repository

Direzione di ricerca

Inizia con l'immagine di esempio dell'issue e i vincoli indicati: preserva i caratteri interi usando un'immagine monocromatica per decidere quali posizioni del testo vengono disegnate. Il repository non fornisce alcun file, test o punto di ingresso, quindi individua prima l'implementazione del rendering del progetto; il lavoro è completo quando produce testo mascherato senza rasterizzare prima il testo, con i font a larghezza variabile come estensione opzionale.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Valutazione

Ambito
computer-graphics
Tipo di issue
Funzionalità
Difficoltà
5/5
Tempo stimato
Più di una settimana
Stato di attività
Ferma
Chiarezza
Abbastanza chiara
Idoneità per principianti
35/100

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.