Skip to content

HosseinKarami/WPStylerAI

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

WPStylerAI

An npm library for WordPress theme creators: Easily convert image-based color palettes into theme.json structures using this Node.js library powered by AI through the OpenRouter API and Google: Gemini Flash 2.0 Experimental.

Current version


Installation

To install wp-styler-ai, run the following command:

npm install wp-styler-ai

Usage

Here's a quick example of how to use wp-styler-ai:

import { ocr } from "wp-styler-ai";

async function main() {
  const json = await ocr({
    filePath: "./test/color-palette.png", // Path to your image
    apiKey: process.env.OPENROUTER_API_KEY, // OpenRouter API key
  });

  console.log(json);
}

main();

This script processes an image and outputs a WordPress theme.json color palette.

How It Works

wp-styler-ai uses Google's Gemini Flash 2.0 Experimental model via the OpenRouter API to perform Optical Character Recognition (OCR) on an image. The extracted color data is then formatted into a WordPress theme.json color palette.

The default model used is google/gemini-2.0-flash-exp:free.

Roadmap

  • Support for local image OCR
  • Generate WordPress theme.json color palettes
  • Add support for typography

Credits

This project was inspired by Llama OCR.

About

Your AI-Powered Assistant for WordPress Theme Colors

Resources

Code of conduct

Stars

Watchers

Forks

Releases

No releases published

Sponsor this project

 

Packages

No packages published