Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AI generated banners without text. #161

Merged
merged 4 commits into from
Feb 6, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 11 additions & 9 deletions scripts/add_text_to_image.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ async function addTextToImage(inputPath: string, outputPath: string, toolName: s
const width = image.width;
const height = image.height;

// Calculate font size (start with 15% of height)
const fontSize = Math.floor(height * 0.15);
// Calculate font size (start with 10% of height)
const fontSize = Math.floor(height * 0.10);
console.log(`Image dimensions: ${width}x${height}, fontSize: ${fontSize}`);

// Load font
Expand All @@ -31,15 +31,17 @@ async function addTextToImage(inputPath: string, outputPath: string, toolName: s
// Create shadow text
const shadowText = Image.renderText(font, fontSize, toolName, 0x000000FF, layout);

// Calculate bottom right position with padding
const padding = Math.floor(height * 0.05); // 5% of height as padding
let x = Math.floor(width - shadowText.width - padding);
let y = Math.floor(height - shadowText.height - padding);
// Calculate center position
let x = Math.floor((width - shadowText.width) / 2);
let y = Math.floor((height - shadowText.height) / 2);
console.log(`Text position: (${x},${y})`);

// Ensure we don't go beyond image boundaries
if (x < 0) x = padding;
if (y < 0) y = padding;
const minPadding = Math.floor(height * 0.05); // 5% of height as minimum padding
if (x < minPadding) x = minPadding;
if (y < minPadding) y = minPadding;
if (x + shadowText.width > width - minPadding) x = width - shadowText.width - minPadding;
if (y + shadowText.height > height - minPadding) y = height - shadowText.height - minPadding;

// Draw shadow with multiple offsets for thickness
for (let offsetX = 1; offsetX <= 4; offsetX++) {
Expand All @@ -61,7 +63,7 @@ async function addTextToImage(inputPath: string, outputPath: string, toolName: s
}

async function readToolMetadata(toolPath: string) {
const metadataPath = join(toolPath, 'metadata.json');
const metadataPath = join(toolPath, 'store.json');
const metadata = JSON.parse(await Deno.readTextFile(metadataPath));
return metadata;
}
Expand Down
Binary file modified tools/article-scraper/banner.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added tools/article-scraper/banner_background.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified tools/arxiv-download/banner.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added tools/arxiv-download/banner_background.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified tools/arxiv-search/banner.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added tools/arxiv-search/banner_background.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified tools/chess-evaluate/banner.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added tools/chess-evaluate/banner_background.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified tools/chess-generate-image/banner.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added tools/chess-generate-image/banner_background.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified tools/chess-move/banner.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added tools/chess-move/banner_background.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified tools/coin-flip/banner.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added tools/coin-flip/banner_background.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion tools/coin-flip/store.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
"categoryId": "5f10d0b4-6acd-477a-96e1-be35634465b2",
"name": "Coin Flip Generator"
"name": "Coin Flip Tool"
}
Binary file modified tools/coinbase-call-faucet/banner.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added tools/coinbase-call-faucet/banner_background.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion tools/coinbase-call-faucet/store.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
"categoryId": "f8b24283-9af3-4a86-a32b-3d1d2f244716",
"name": "Coin Manager"
"name": "Coinbase Call Faucet"
}
Binary file modified tools/coinbase-create-wallet/banner.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion tools/coinbase-create-wallet/store.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
"categoryId": "f8b24283-9af3-4a86-a32b-3d1d2f244716",
"name": "Coin Manager"
"name": "Coinbase Create Wallet"
}
Binary file modified tools/coinbase-get-balance/banner.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added tools/coinbase-get-balance/banner_background.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion tools/coinbase-get-balance/store.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
"categoryId": "f8b24283-9af3-4a86-a32b-3d1d2f244716",
"name": "Coin Manager"
"name": "Coinbase Get Balance"
}
Binary file modified tools/coinbase-get-my-address/banner.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion tools/coinbase-get-my-address/store.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
"categoryId": "f8b24283-9af3-4a86-a32b-3d1d2f244716",
"name": "Coin Manager"
"name": "Coinbase Get My Address"
}
Binary file modified tools/coinbase-get-transactions/banner.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion tools/coinbase-get-transactions/store.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
"categoryId": "f8b24283-9af3-4a86-a32b-3d1d2f244716",
"name": "Coin Manager"
"name": "Coinbase Get Transactions"
}
Binary file modified tools/coinbase-send-tx/banner.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added tools/coinbase-send-tx/banner_background.png
2 changes: 1 addition & 1 deletion tools/coinbase-send-tx/store.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
"categoryId": "f8b24283-9af3-4a86-a32b-3d1d2f244716",
"name": "Coin Manager"
"name": "Coinbase Send Transaction"
}
Binary file modified tools/coingecko-get-coins/banner.png
Binary file added tools/coingecko-get-coins/banner_background.png
2 changes: 1 addition & 1 deletion tools/coingecko-get-coins/store.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
"categoryId": "f8b24283-9af3-4a86-a32b-3d1d2f244716",
"name": "Coin Manager"
"name": "Coingecko Get Coins"
}
Binary file modified tools/coingecko-get-historical-data/banner.png
2 changes: 1 addition & 1 deletion tools/coingecko-get-historical-data/store.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
"categoryId": "f8b24283-9af3-4a86-a32b-3d1d2f244716",
"name": "Coin Manager"
"name": "Coingecko Get Historical Data"
}
Binary file modified tools/dev-airtable/banner.png
Binary file added tools/dev-airtable/banner_background.png
Binary file modified tools/dev-github/banner.png
Binary file added tools/dev-github/banner_background.png
Binary file modified tools/dev-gmail/banner.png
Binary file added tools/dev-gmail/banner_background.png
Binary file modified tools/dev-google-drive/banner.png
Binary file added tools/dev-google-drive/banner_background.png
Binary file modified tools/dev-twitter/banner.png
Binary file added tools/dev-twitter/banner_background.png
Binary file modified tools/download-page/banner.png
Binary file added tools/download-page/banner_background.png
2 changes: 1 addition & 1 deletion tools/download-page/store.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
"categoryId": "5f10d0b4-6acd-477a-96e1-be35634465b2",
"name": "Downloads URL Converts"
"name": "Convert Webpage to Markdown"
}
Binary file modified tools/duckduckgo-search/banner.png
Binary file added tools/duckduckgo-search/banner_background.png
Binary file modified tools/elevenlabs-isolate-voice/banner.png
2 changes: 1 addition & 1 deletion tools/elevenlabs-isolate-voice/store.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
"categoryId": "b31efbe7-2b3e-4fa1-bd7d-b19950705ea2",
"name": "Isolates Audio Youtube"
"name": "ElevenLabs Isolate Voice"
}
Binary file modified tools/elevenlabs-text-to-speech/banner.png
2 changes: 1 addition & 1 deletion tools/elevenlabs-text-to-speech/store.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
"categoryId": "5f10d0b4-6acd-477a-96e1-be35634465b2",
"name": "Converts Text Speech"
"name": "ElevenLabs Text to Speech"
}
Binary file modified tools/email-imap-fetcher/banner.png
Binary file added tools/email-imap-fetcher/banner_background.png
Binary file modified tools/email-responder/banner.png
Binary file added tools/email-responder/banner_background.png
Binary file modified tools/email-sender/banner.png
Binary file added tools/email-sender/banner_background.png
Binary file modified tools/file-read/banner.png
Binary file added tools/file-read/banner_background.png
2 changes: 1 addition & 1 deletion tools/file-read/store.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
"categoryId": "5f10d0b4-6acd-477a-96e1-be35634465b2",
"name": "Reads Text Contents"
"name": "Read File Contents"
}
Binary file modified tools/file-update/banner.png
Binary file added tools/file-update/banner_background.png
2 changes: 1 addition & 1 deletion tools/file-update/store.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
"categoryId": "5f10d0b4-6acd-477a-96e1-be35634465b2",
"name": "Applies Prompt File"
"name": "Update File with Prompt"
}
Binary file modified tools/file-write/banner.png
Binary file added tools/file-write/banner_background.png
2 changes: 1 addition & 1 deletion tools/file-write/store.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
"categoryId": "5f10d0b4-6acd-477a-96e1-be35634465b2",
"name": "Writes Text Contents"
"name": "Writes File Contents"
}
Binary file modified tools/game-crypto-2048/banner.png
Binary file added tools/game-crypto-2048/banner_background.png
2 changes: 1 addition & 1 deletion tools/game-crypto-2048/store.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
"categoryId": "5f10d0b4-6acd-477a-96e1-be35634465b2",
"name": "Automatically Play Crypto"
"name": "Crypto 2048 Game"
}
Binary file modified tools/google-news-search/banner.png
Binary file added tools/google-news-search/banner_background.png
Binary file modified tools/google-search/banner.png
Binary file added tools/google-search/banner_background.png
Binary file modified tools/hacker-news/banner.png
Binary file added tools/hacker-news/banner_background.png
Binary file modified tools/iterm-control/banner.png
Binary file added tools/iterm-control/banner_background.png
Binary file modified tools/iterm-read/banner.png
Binary file added tools/iterm-read/banner_background.png
Binary file modified tools/iterm-write/banner.png
Binary file added tools/iterm-write/banner_background.png
Binary file modified tools/macos-calendar/banner.png
Binary file added tools/macos-calendar/banner_background.png
Binary file modified tools/macos-clipboard/banner.png
Binary file added tools/macos-clipboard/banner_background.png
Binary file modified tools/macos-finder/banner.png
Binary file added tools/macos-finder/banner_background.png
Binary file modified tools/macos-iterm/banner.png
Binary file added tools/macos-iterm/banner_background.png
Binary file modified tools/macos-notifications/banner.png
Binary file added tools/macos-notifications/banner_background.png
Binary file modified tools/macos-say-text-to-audio/banner.png
Binary file modified tools/macos-system/banner.png
Binary file added tools/macos-system/banner_background.png
Binary file modified tools/math-exp/banner.png
Binary file added tools/math-exp/banner_background.png
Binary file modified tools/meme-generator/banner.png
Binary file added tools/meme-generator/banner_background.png
Binary file modified tools/memory/banner.png
Binary file added tools/memory/banner_background.png
Binary file modified tools/mermaid/banner.png
Binary file added tools/mermaid/banner_background.png
Binary file modified tools/news-aggregator/banner.png
Binary file added tools/news-aggregator/banner_background.png
Binary file modified tools/ntfy-push/banner.png
Binary file added tools/ntfy-push/banner_background.png
Binary file modified tools/pdf-summarize-to-audio/banner.png
Binary file modified tools/pdf-text-extractor/banner.png
Binary file added tools/pdf-text-extractor/banner_background.png
Binary file modified tools/pdf-whitepaper-analyzer/banner.png
Binary file modified tools/perplexity-api/banner.png
Binary file added tools/perplexity-api/banner_background.png
Binary file modified tools/perplexity/banner.png
Binary file added tools/perplexity/banner_background.png
Binary file modified tools/podcast-to-podcast/banner.png
Binary file added tools/podcast-to-podcast/banner_background.png
Binary file modified tools/pubmed-search/banner.png
Binary file added tools/pubmed-search/banner_background.png
Binary file modified tools/shinkai-question-learner/banner.png
Binary file modified tools/smart-search/banner.png
Binary file added tools/smart-search/banner_background.png
Binary file modified tools/stagehand-generic/banner.png
Binary file added tools/stagehand-generic/banner_background.png
Binary file modified tools/stock-technical-analysis/banner.png
Binary file modified tools/system-hw-info/banner.png
Binary file added tools/system-hw-info/banner_background.png
Binary file modified tools/text-to-audio-kokoro/banner.png
Binary file added tools/text-to-audio-kokoro/banner_background.png
Binary file modified tools/twitter-post/banner.png
Binary file added tools/twitter-post/banner_background.png
Binary file modified tools/webcam-capture/banner.png
Binary file added tools/webcam-capture/banner_background.png
Binary file modified tools/wikimedia-featured-content/banner.png
Binary file modified tools/wikimedia-historical-events/banner.png
Binary file modified tools/wikimedia-page-content/banner.png
Binary file modified tools/wikimedia-search-titles/banner.png
Binary file modified tools/wikimedia-search/banner.png
Binary file added tools/wikimedia-search/banner_background.png
Binary file modified tools/x-twitter-search/banner.png
Binary file added tools/x-twitter-search/banner_background.png
Binary file modified tools/youtube-download-mp3/banner.png
Binary file added tools/youtube-download-mp3/banner_background.png
Binary file modified tools/youtube-search/banner.png
Binary file added tools/youtube-search/banner_background.png
Binary file modified tools/youtube-summary/banner.png
Binary file added tools/youtube-summary/banner_background.png
Loading