Comments (10)
@Correct-Syntax ,Thank you very much.
Will start as soon as possible.
from gimelstudio.
Thanks for the additional thoughts, @iwoithe Looking at freetype-py, that actually seems like it could work.
I should say that I don't see using Pillow or sticking with OpenImageIO as options.
Ideally, we want to do as many of the image processing nodes on the gpu side of things using opengl/glsl as much as possible. This gives us the freedom to edit in high quality and, in theory, it will be faster. Plus, it's easier to translate opengl calls/glsl to anything we may do in the future (I think). So, my preference would be freetype-py + opengl/glsl if that works.
I think the real question is, @Yashupadhyay603 how comfortable are you with tackling this either using opencv or via freetype-py and opengl? Do you have experience with opengl/glsl?
Either of those would be acceptable for re-implementing this node, so whichever one works and you are comfortable using would be great.
For the opencv way, this: https://stackoverflow.com/a/57502572/12787591 may point in the right direction.
For the freetype-py + opengl way, that may involve some research on how to render the text to the opengl texture, etc.
I'm beginning to realize that the scope of this issue could be pretty big, so if you'd just rather not do it that is okay. But, if you're up for the challenge then I'll do my best to assist as time permits.
from gimelstudio.
Yeah, that would be a problem. OpenCV only has only a handful of fonts it can use, while OpenImageIO could use most any font (ref).
Text rendering via glsl/opengl is a complex topic, so I'm not even sure if you want to look into that.
I briefly looked into it (in case we want to go this route) and here's what I came up with:
- moderngl/moderngl#203
- moderngl/moderngl-window#25
- https://github.com/IntQuant/qlibs (has text rendering feature)
There's also the Pillow library, but it has it's own set of problems.
- We basically throw away a lot of data since Pillow only supports 8-bit (a waste since we are aiming for 16-bit editing)
- It's another dependency
@iwoithe, any ideas?
from gimelstudio.
There's also the Pillow library, but it has it's own set of problems.
We removed Pillow as a dependency a while back. I'd suggest to keep it this way if we can.
OpenCV only has only a handful of fonts it can use
Not sure how this translates to Python, but using custom fonts seems possible.
https://docs.opencv.org/4.1.1/d9/dfa/classcv_1_1freetype_1_1FreeType2.html
@iwoithe, any ideas?
I was also going to suggest GLSL until I looked into it. 🙄
The only other thing I can think of that you haven't suggested is using freetype-py. Not sure if it has all the features we currently have or if this will work at all with ModernGL/Numpy.
So, the order of my preference:
- OpenCV
- freetype-py (?)
- Keep using OpenImageIO
I will state that I would rather not use Pillow for the reasons @Correct-Syntax suggested (i.e. loss of 16-bit editing and another dependency). Also still not sure about freetype-py, so if OpenCV doesn't work out, I will let @Correct-Syntax decide whether to look into freetype-py or remain using OpenImageIO.
Hopefully there's something in this that helps. 🙂
from gimelstudio.
Thank you very much, @Correct-Syntax and @iwoithe for such good suggestions.
I will look over both of the ways and see which one would require least changes without loosing any functionality.
from gimelstudio.
Hello, @Correct-Syntax .
May I work on this rewriting?
from gimelstudio.
Hi, @Yashupadhyay603. Sure I'll assign you. If you have any questions feel free to ask.
from gimelstudio.
Hello @Correct-Syntax, I have seen the code to be changed .
I want to ask , how many fonts does OpenImageIO supports as opencv support only few types.
so using opencv would allow to use only few fonts.
from gimelstudio.
@Correct-Syntax , @iwoithe .
I have looked into both of these implementations and come to see a common process of importing font data from .ttf file.
So to import multiple font data we have to add their respective .ttf file in the project and then we can use custom fonts using OpenCV.
What are your suggestions regarding this ?
from gimelstudio.
We want to access the system fonts
folder and get a list of the available ttf fonts on the user's computer. Then use that to populate the font selector dynamically.
from gimelstudio.
Related Issues (20)
- Implement properties panel
- Add SVG property type
- Add the primary nodes
- Implement the viewport
- Add developer documentation
- Implement SVG generation
- Rewrite Noise Image node to use GLSL instead of OIIO HOT 12
- Rewrite Checkered Image node to use GLSL instead of OIIO HOT 2
- [TASK] Implement the save confirmation dialog HOT 1
- Configuration file is not automatically created if it doesn't exist
- Fix transparency when editing images with GLSL-based nodes HOT 2
- Add CI/CD builds and checks for PRs HOT 2
- Add logging system HOT 4
- Clicking from node to node should update the render output, otherwise it is difficult to evaluate steps in the node chain. HOT 1
- RMB wasted on Select/Deselect HOT 1
- Delete key does not delete node
- A transform node would seem useful, and a Match Dimensions shortcut HOT 1
- Acknowledge all contributors HOT 1
- on Linux build.py is looking for an old version of python. HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from gimelstudio.