npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

@bicou/directus-extension-imagga

v1.6.1

Published

Automatic image tagging of Directus files with Imagga API

Downloads

93

Readme

Imagga for Directus

npm version npm downloads License

This is a Directus hook for file uploads to automatically tag images with Imagga API.

Requirements

This extension requires Directus 10 or higher to be installed.

Installation

Add @bicou/directus-extension-imagga dependency to your directus project.

# Using pnpm
pnpm add @bicou/directus-extension-imagga
# Using yarn
yarn add @bicou/directus-extension-imagga
# Using npm
npm install @bicou/directus-extension-imagga

Usage

Configure the extension with environment variables (in a .env file for example) :

Authorization

The credentials are available in your Imagga user dashboard.

| Key | Description | | --------------- | ---------------------------------------- | | IMAGGA_KEY | Imagga API key on your user dashboard | | IMAGGA_SECRET | Imagga API secret on your user dashboard |

Configuration

Tags service

Automatically suggest textual tags from images.

| Key | Description | Default | | ----------------------- | ------------------------------------------------ | ------------- | | IMAGGA_TAGS_ENABLE | enables auto tagging | true | | IMAGGA_TAGS_LIMIT | limits the number of tags in the result | -1 (no limit) | | IMAGGA_TAGS_THRESHOLD | thresholds the confidence of tags in the result | 0.0 | | IMAGGA_TAGS_LANGUAGE | get a translation of the tags in other languages | en |

Please refer to Imagga Tags API documentation for more information.

Colors service

Analyse and extract the predominant colors from images.

| Key | Description | Default | | ---------------------- | ------------------------- | ------- | | IMAGGA_COLORS_ENABLE | enables colors extraction | false |

Please refer to Imagga Colors API documentation for more information.

Demo

An example of an image uploaded in the file library of Directus whose tags are automatically filled in :

Play screencast video

Results

Tags

The result is stored as an array of strings in the directus_files.tags field.

{
  "tags": ["lake", "boathouse", "lakeside", "mountain", "shore", /*...*/]
}

Colors

The result is stored under the colors key of the directus_files.metadata field.

{
  "colors": {
    "background": [
      { "r": 25, "g": 40, "b": 36, "html_code": "#192824", "percent": 55.2785682678223 }, // ...
    ],
    "foreground": [
      { "r": 92, "g": 88, "b": 92, "html_code": "#5c585c", "percent": 41.5135154724121 }, // ...
    ],
    "image": [
      { "r": 24, "g": 36, "b": 34, "html_code": "#182422", "percent": 43.4364776611328 }, // ...
    ]
  }
}

License

This extension is released under the MIT license. See the LICENSE file for more details.