Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@sean_kenny/tga-to-png-js

Package Overview
Dependencies
Maintainers
0
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@sean_kenny/tga-to-png-js

A library which parses a Truevision TGA (.tga) file and uses sharp to transform it into to a png file.

  • 0.1.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
0
decreased by-100%
Maintainers
0
Weekly downloads
 
Created
Source

tga-to-png-js

This is a TypeScript library which contains a function which converts a Truevision TGA .tga image file into a .png file by using sharp.

Version Downloads/week

Installation and Usage

$ npm install --save-dev @sean_kenny/tga-to-png-js
# or
$ yarn add -D @sean_kenny/tga-to-png-js

An output file can be generated by calling the transformTgaFileToPngFile function as below.

const { metadata } = transformTgaFileToPngFile({
  inputFilePath: 'path/to/the/file/you/want/to/read/file.tga',
  outputFilePath: 'path/to/wherever/you/want/to/write/to/file.png'
})

A .png file will be written to outputFilePath and you will receive metadata in the following format.

{
  "imageIdLengthBytes": 0,
  "colourMapPresent": false,
  "imageType": "RUN_LENGTH_ENCODED_TRUE_COLOUR_IMAGE",
  "colourMapSpecification": {
    "firstEntryIndex": 0,
    "numberOfEntriesInColourMap": 0,
    "colourMapEntrySizeBits": 0
  },
  "imageSpecification": {
    "xOrigin": 0,
    "yOrigin": 0,
    "imageWidthPx": 128,
    "imageHeightPx": 128,
    "imageBitsPerPixel": 24,
    "alphaChannelDepth": 1,
    "horizontalPixelOrdering": "RIGHT_TO_LEFT",
    "verticalPixelOrdering": "BOTTOM_TO_TOP"
  }
}

Acknowledgements

All sample input files which are used for testing are pulled directly from the ab937cf899b75f74662a17574bd0d46072793beb version of Anbennar which was published to Bitbucket on August 23rd 2024. All credit for those image files go to their creator.

FAQs

Package last updated on 05 Sep 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc