haashemi.dev – Telegram
haashemi.dev
106 subscribers
38 photos
2 files
50 links
Personal channel

Contact: @Byfron
Website: https://haashemi.dev
Download Telegram
Channel created
🌹 Hi!

🌗 About me:
I'm Ali Hashemi.
A Back-end developer who is passionate about developing internal, single-purpose, security-critical REST APIs.


🥲 Tech Stack:
Go / TS
Postgres


🥵 Social Media:
🧩 haashemi
📷 haashemi
🧩 haashemi
🧩 haashemi.dev
🧩 contact@haashemi.dev
Please open Telegram to view this post
VIEW IN TELEGRAM
2🤡108🔥2🎄11
🫥 Linear Gradient | Godot shader

🫥 I was trying to implement a linear gradirnt using golang's image stdlib by myself. I succeed somehow, but the result was not what I wanted. until I found this!

🤪 I'll implement it in Go, soon.

🧊| Additional Links:
Smoothstep
Clamp

.
Please open Telegram to view this post
VIEW IN TELEGRAM
6🤡4🔥3111
🤪 I DID IT!

🫥 After hours of reading and learning about shaders and how they works, I finally figured it out to how to implement it in Go!

🫥 The performance... it generates the 1000x1500 image in ~95ms (10FPS). which is OK.

❤️| I learned a lot from such a thing. it was also pretty fun! I still have to get deeper into it, tho.

🧊 Additional Links:
Another implementation
Degrees to radians
Mix Vectors
What's Arctan?

.
Please open Telegram to view this post
VIEW IN TELEGRAM
8🔥5🤡5👍21111
😼 Performance issue fixed!

🫥 That image was taking ~90ms, right? but not anymore!

🫥 After playing with goroutines, I made it 12 times faster! Now it generates it in just 7ms!

🫥 The magic behind, is just it generates multiple (2*CPU Cores) rows at the same time. Which also means in production level, it would highly depends on the host machine.

📝 Other type of image generation things, soon...

.
Please open Telegram to view this post
VIEW IN TELEGRAM
7🔥3🤡3👍1111
🫥 Radial Gradient implementation

🫥 It was just a simple migration, as It was already implemented here.

😡 There are still a lot of other things to do btw. it's too early to publish it as a package.

.
Please open Telegram to view this post
VIEW IN TELEGRAM
🔥4🤡43111
🫥 Introducing Painter (WIP)

🫥 A simple RGBA image drawing package for Go

👍 I wanted to complete it and then publish it, but I like development in public more.

🧊| Repository:
https://github.com/haashemi/painter

.
Please open Telegram to view this post
VIEW IN TELEGRAM
🔥54🤡3211
🫥 Added support for transparent colors!

🫥 Now, it takes care of its background and transparent overlay color! It merges them together first and then sets the pixel's color.

🧊 Repository:
github.com/haashemi/painter

.
Please open Telegram to view this post
VIEW IN TELEGRAM
🔥4🤡41111
🫥 Added RenderRect

🫥 With this method, you're able to call the renderer on a specific part of the image. in this example, we drew a linear gradient at the bottom of the image with height of (1920-1200=720)px

🧊 Repository:
github.com/haashemi/painter

.
Please open Telegram to view this post
VIEW IN TELEGRAM
8🔥3🤡3111
🫥 Painter daily update

1⃣ Added FillColor
—— Renders a flat color on the image.
painter.Render(img, painter.FillColor(color.RGBA{A: 255}))
2⃣ Added Decode
—— Decodes the image with type of png, jpeg, and webp.
img, err := painter.Decode(f)
👀 Up Next: Writer

.
Please open Telegram to view this post
VIEW IN TELEGRAM
🔥3🤡33111
🫥 How fonts actually work?

🫥 To implement the Writer in the right way, I should have some knowledge about them first.

🧊 So, I'll share interesting/useful things here.

stdlib packages:
—— x/image/font
—— x/image/font/opentype
—— x/image/font/sfnt

Docs, Articles, blogs, etc.
—— Naming table (OpenType)
—— Naming table Example
—— FreeType Glyph Conventions

🔹 This post will be edited until I start the implementation.

.
Please open Telegram to view this post
VIEW IN TELEGRAM
4🤡3👍1🔥1111
⭐️ Where are fonts stored? (mostly)

🔹 Windows: [source]
C:\Windows\Fonts

🔹 MacOS: [source]
~/Library/Fonts/
/Library/Fonts/
and some cutsom dirs? (doesn't matter)

🔹 Linux: [source]
No one knows how this shit works, but:
/usr/share/fonts
/usr/local/share/fonts
~/.local/share/fonts

.
🤡44👍2👎1111