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 🙏

© 2026 – Pkg Stats / Ryan Hefner

animepic-utils

v0.0.9

Published

Node.js utils for processing anime images

Readme

Some utilities for processing anime images. (However I guess it'll work for any images).

Pixiv Refresh Token

To obtain your pixiv refresh token for the methods that require it, you can use the pixivauth.py script from PixivPy. I included it in the base of the github repository.

The primary function is processImages that accepts a folder of images, and then a variable amount of processing functions that will be applied to every image in the folder. The processing functions should take the current file parameter and return the path to the output, this is then fed back as the "file" argument to the next function in the chain. See below for an example of using it.

import imageUtils from "animepic-utils"

await imageUtils.processImages(folder, 
    async (file) => this.resizeImage(file),
    async (file) => this.convertImage(file),
    async (file) => this.upscaleImage(file, upscaledFolder)
)

We already have functions for resizing, conversion, and upscaling, but you can continue to write your own if you wish. Apart from image processing, there is the fixFileExtensions function that will correct the file extensions of all the images in a folder. On macOS, the extensions have to be correct in order for the file to preview in finder, so a png cannot have the jpg extension.

import imageUtils from "animepic-utils"

await imageUtils.fixFileExtensions(folder)

Anime specific

The function recoverFromPixiv takes a folder of arbitrarily named images and attempts to recover the original images from pixiv, or danbooru as a fallback. Files which are unrecoverable will be put into an "unrecoverable" folder, usually because it was deleted and not archived anywhere.

import imageUtils from "animepic-utils"

await imageUtils.recoverFromPixiv(folder, process.env.PIXIV_REFRESH_TOKEN)

The reverseImageSearch function reverse searches the image on iqdb and returns the found danbooru post, since usually this is the site with the most info.

import imageUtils from "animepic-utils"

await imageUtils.reverseImageSearch(imagePath)

The filterAIImages function attempts to filter out AI images from a folder containing pixiv images. If you have images that aren't on pixiv, you will have to use your best judgement...

import imageUtils from "animepic-utils"

await imageUtils.filterAIImages(folder, process.env.PIXIV_REFRESH_TOKEN)

The function moepicsProcess takes a folder of anime images and will generate the compressed and upscaled versions that are suitable to upload to my website, https://moepictures.net.

import imageUtils from "animepic-utils"

await imageUtils.moepicsProcess(folder)

We also use filename qualifiers in order to group related images. Images can be grouped together as variations, grouped separately as groups, added as child posts to the first image (_c0), or uploaded completely separately. This comes from most posts on pixiv already using the _p0 (page number) qualifier in the names.

You can change the qualifiers for images in a folder with the changeQualifiers method.

import imageUtils from "animepic-utils"

await imageUtils.changeQualifiers(folder, "g")

These are the full list of qualifiers:

  • _s or none - Uploads images seperately
  • _p - Joins images together into one post as variations
  • _g - Uploads images seperately but adds them to the same group
  • _g! - Adds the image as a variation to the previous group post
  • _c - Adds images as child posts to the first in the set (_c0)
  • _c! - Adds the image as a variation to the previous child post