[Lavanya Deepak] Lavanya Deepak
Technology for Better Business and Higher Standards of Life

Monday, March 30, 2026

When Threads Silences Your Temple Bell

When Threads Silences Your Temple Bell — A Dev's Workaround
Dev Story · Text as Image

How a century-old daily ritual met a modern platform algorithm — and a Node.js script won.

March 2025 Node.js · Canvas API 5 min read

The Daily Ritual

Every morning, before sunrise, a panchangam — the sacred Hindu almanac — is compiled and shared across WhatsApp groups, Instagram pages, and social media feeds. It lists the tithi (lunar day), nakshatra (star), auspicious times, and the daily sankalpam that devout families recite before prayers. For thousands of families, this small block of text is as essential as morning coffee.

Nagai Narasimhan, who has been compiling and sharing this daily almanac for years, encountered a strange wall: Threads kept silently suppressing his posts. Every other platform — Instagram, WhatsApp, Facebook — accepted the content without complaint. But Threads? Crickets.

"The panchangam reaches people who depend on it daily. An algorithm shouldn't decide whether someone knows Rahu Kalam today."

Why Threads Blocks It

Threads (and many other platforms) run text through natural language classifiers at upload time. These systems look for patterns: density of non-Latin Unicode characters, repetition, structured formatting, or blocks of religious text that may trigger overzealous spam filters. The panchangam, written in a Tamil-English mix with diacritical characters, structured time tables, and repeated formatting marks like ===== — ticks many of those boxes.

The irony is sharp: this is not spam. It is a curated cultural document, hand-compiled daily. But the algorithm sees patterns, not intent.

Root cause

Text classifiers on social platforms operate on Unicode character distributions and formatting heuristics. Dense Tamil script mixed with structured repeated symbols closely resembles patterns associated with bulk/spam posting — regardless of the actual content.

The Fix: Render Text as an Image

The solution is elegantly simple. If the platform can't read your text, don't give it text. Render your content onto a canvas as pixels — to a human it is perfectly legible; to a text classifier, it is just a JPEG.

panchangam.txt
Node Canvas
panchangam.png
Post to Threads

The Code

The implementation uses the canvas npm package, which provides a Node.js binding to the Cairo graphics library — the same engine behind most Linux desktop rendering. Here's the full script:

texttoimage.js — Node.js
// install with: npm install canvas
const { createCanvas } = require('canvas');
const fs = require('fs');
const path = require('path');

// Read the panchangam text file
const text = fs.readFileSync(
  path.join(__dirname, 'panchangam.txt'), 'utf8'
);

const lines = text.split('\n');
const width = 800;
const lineHeight = 30;
// Dynamic height — grows with content
const height = (lines.length * lineHeight) + 40;

const canvas = createCanvas(width, height);
const ctx = canvas.getContext('2d');

// White background
ctx.fillStyle = '#fff';
ctx.fillRect(0, 0, width, height);

// Text styling — use a Unicode-capable font
ctx.fillStyle = '#000';
ctx.font = '20px "Nirmala UI", "Latha", Arial, sans-serif';
ctx.textBaseline = 'top';

// Draw each line
let y = 20;
for (const line of lines) {
  ctx.fillText(line, 20, y);
  y += lineHeight;
}

// Save as PNG
const buffer = canvas.toBuffer('image/png');
fs.writeFileSync('panchangam.png', buffer);
console.log('Image saved as panchangam.png');

How It Works — Line by Line

1. Reading the Source File

The script reads panchangam.txt synchronously and splits it by newline. Each line becomes one row on the canvas. This approach handles both Tamil and English text in the same document, because the rendering is purely graphical — no encoding translation needed.

2. Dynamic Canvas Height

Rather than hardcoding an image size, the height is calculated as (number of lines × 30px) + 40px padding. This means the script adapts automatically — a short day with few auspicious timings and a long day with a detailed sankalpam both produce correctly-sized images.

3. Font Selection Matters

The font stack "Nirmala UI", "Latha", Arial is deliberate. Nirmala UI and Latha are system fonts on Windows that have full coverage of Tamil Unicode. On Linux/Mac servers, you may need to install a Tamil font and register it explicitly with the canvas library:

registering a custom Tamil font
const { registerFont } = require('canvas');
registerFont('./fonts/Latha.ttf', { family: 'Latha' });
// Call BEFORE createCanvas()

4. The PNG Output

canvas.toBuffer('image/png') produces a lossless PNG. This is important for text — JPEG compression creates artefacts around sharp character edges (ringing), making Tamil letterforms harder to read. PNG keeps every pixel crisp.

· · ·

Broader Applications

This pattern — text → canvas → image — has a long history and many legitimate uses:

  • Daily almanacs & religious content in minority-script languages that trip spam filters
  • Watermarked quotations — render text with a logo overlay that plain text cannot carry
  • Code screenshots in the style of Carbon.sh, for sharing syntax-highlighted snippets visually
  • Infographic text cards with custom backgrounds and branding, generated server-side at scale
  • OG images (Open Graph) — auto-generated preview cards for blog posts using the same canvas approach

Accessibility Note

One tradeoff of this approach is that the text is no longer machine-readable inside the image. Screen readers cannot parse it, and search engines won't index the content. Best practice when using this technique: always include the full text in the post caption or as alt text on the image. Threads and Instagram both support alt text on images — fill it in. The algorithm won't block it; the content lives as pixels. But your audience who needs accessibility support, and search crawlers, can still find the text.

Quick checklist before posting
  • Image rendered with a Unicode-capable font
  • Saved as PNG (not JPEG) for sharp text
  • Alt text filled with the full original text
  • Caption includes key timings for quick scanning

Running It Daily — Automation

The final step is making this effortless. On any Linux/Mac system, a single cron job handles it:

crontab — run every morning at 5:30 AM
30 5 * * * cd /home/user/panchangam && node texttoimage.js

Pair this with a social media scheduling tool (Buffer, Meta Business Suite, or a custom Threads API integration) and the image posts itself — every day, without manual intervention, without tripping any classifier.

· · ·

Closing Thought

There is something quietly poetic about this solution. Sanskrit and Tamil have been encoded in stone, palm leaf, and paper for thousands of years. Today, a few lines of JavaScript encode them as pixels to slip past a neural network. The medium changes; the message endures.

If you maintain a community page that shares culturally specific content in non-Latin scripts and you've hit similar walls — this technique works. It's three npm installs and fifty lines of code. The daily panchangam will reach its readers.

nodejs canvas tamil panchangam text-to-image social-media unicode threads

Inspired by the daily work of Nagai Narasimhan  ·  +91 99675 04474

Code is MIT licensed · Share freely

Wednesday, May 10, 2023

[Imported from Blogdrive]Online Virus Scanners

Online Virus Scanners

Virus Scanners are no longer difficult to install, tedious to configure. There are easy to use Online Virus Scanners, which offer to scan your hard disks whilst you surf the Internet.

Check out the following:

FSecure Virus Scanner: http://support.f-secure.com/enu/home/ols.shtml
Trend Micro Housecall: http://housecall.antivirus.com/

Keep your system protected against spreading viruses...

Posted at 05:30 pm by Deepak Kumar Vasudevan




Original BlogDrive Post on Tuesday, May 10, 2005

Thursday, September 01, 2022

Some basic levels in Perimeter Protection

 

A basic home office setup with the following components can definitely offer a decent level of protection against Phishing.

 

  1. A Chromium based Web Browser
  2. AVG Antivirus
  3. Cisco Umbrella OpenDNS

 

A sample URL picked up Phishtank to test the same.

 

Opera (Chromium based Browser) presents a recommendation not to visit the URL. (Override-able by the user)

 

image

 

TCP level protection by Web Shield component of AVG Antivirus (not override-able by the user without confirmation using administrative privileges)

image

If a link escapes these two protection by any chance, Cisco Umbrella to have its sway (not override-able by the user without confirmation using administrative privileges)

image

Monday, May 30, 2022

JSON Standard for Resume

Innovations can never be stifled. And one innovation and its implementation always seeds another. We have been having our profiles (aka) Curriculum Vitae (aka) Resume in notepad text files a few years ago and then moved onto Word and PDF format files for rich presentation.

Then came video profiles which were more commonly used by media personnel.

Having seen a diverse set of formats to present the profiles the new trend now is an open standards for resume based on JSON You can find more details about it from here and can contribute your technical excellence and/or feedback here.

A simple .JSON resume as a public gist at https://gist.github.com/ can be used as an input to the parser hosted by JSON resume which supports a lot of themes to publish as a profile website.

For example this blogger has their JSON resume here.

 

Saturday, February 12, 2022

Switching SQL Server between Multi-User and Single User mode with a simple T-SQL

Recently had to manage database deployments where the SQL Server was hosted with a cloud solution provider of repute. The database was quite huge and hence during backup and restore had to switch the same to Single User mode. However the database was so huge that even after service refresh the right click properties on the database was not able to open because of resource contingency.

Hence I chose to have this switch done through simple T-SQL which I would like to share the same here for everyone’s benefit.

To Switch to Single User Mode:


use master
go
alter database [YourDatabaseName] set single_user with rollback immediate

 

To Return Back to Normal/Multi-User Mode:

use master
go
alter database [YourDatabaseName] set single_user with rollback immediate

Additionally there is one more argument called WITH NOWAIT which could be used if needed

Saturday, October 23, 2021

Installing Visual Studio Code on Linux

 As part of the LinuxMint journey described here, as part of setting up the development environment I chose to get Visual Studio Code on the system.

There are two ways to install the same. One way is to grab the *.deb (Debian) package from Microsoft Visual Studio code website.

Alternatively you can use the following from the command prompt

wget -qO- https://packages.microsoft.com/keys/microsoft.asc | gpg --dearmor > packages.microsoft.gpg

sudo install -o root -g root -m 644 packages.microsoft.gpg /etc/apt/trusted.gpg.d/

sudo sh -c 'echo "deb [arch=amd64,arm64,armhf signed-by=/etc/apt/trusted.gpg.d/packages.microsoft.gpg] https://packages.microsoft.com/repos/code stable main" > /etc/apt/sources.list.d/vscode.list'

  rm -f packages.microsoft.gpg

  sudo apt install apt-transport-https

   sudo apt update

  sudo apt install code # or code-insiders


Installing Opera with Linux

 As part of starting the LinuxMint journey, the first software I got it on the computer was Opera. However installing Opera is not straight-forward because the package is not configured out of the box from the Linux distribution. There are two ways to install the same.

1) Download the *.deb (Debian) package from Opera and install the same.

Alternatively follow these instructions on command prompt for the same.

    sudo sh -c 'echo "deb http://deb.opera.com/opera/ stable non-free" >> /etc/apt/sources.list.d/opera.list'

    sudo sh -c 'wget -O - http://deb.opera.com/archive.key | apt-key add -'

    sudo apt-get update

    sudo apt-get install opera-stable


A Gentle Journey with Linux Mint

 Had a few assignments to complete through Linux platform and hence chose LinuxMint this time. The code name for 20.x version is #Uma (a sweet Indian name)



If I recall my first date with Linux Mint it was exactly 10 years ago (2011) but due to a lot of personal turbulence the exploration got totally and abruptly stopped and forgotten. And interestingly and with divine bless there is a reunion now.


Sunday, August 15, 2021

Overcoming Windows Block limitation of Downloaded Files

The biggest trouble at times with Microsoft Windows is that after downloading a file it blocks you from opening the same citing unavailability of its listing in Microsoft Store Screenshot below

 

ms

 

Fortunately there is an easy way to address this situation. Locate the file where you have downloaded the same and navigate to properties. There will be a new checkbox called Unblock. Just select the same and click Apply/OK.

 

This tip is to overcome the limitation imposed by Microsoft Windows. However to make sure your computer is not inadvertently exposed to security risks, make sure there is a full fledged antivirus running in realtime to monitor all file activities.

 

 

ms1