@monogrid/lut-loader

0.0.2 • Public • Published

lut-loader

A webpack loader that enable to bundle LUT files as PNG

Installation

npm install lut-loader

or

yarn add lut-loader

Webpack Configuration

You can use lut-loader in combination with other loaders.

For example, if you want to parse a .cube file and import it as PNG directly in your source code you have to do:

module: {
  rules: [{
    test: /\.cube$/,
    use: [
      {
        loader: 'file-loader',
        options: {
          name: utils.assetsPath('assets/lut/[name].[hash:7].png')
        }
      },
      {
        loader: 'lut-loader'
      }
    ]
  }]
}

or if you want to obtain only the buffer data:

module: {
  rules: [{
    test: /\.cube$/,
    use: [
      {
        loader: 'lut-loader'
      }
    ]
  }]
}

example of usage:

import LUTNight from './assets/luts-source/night.cube'

// ...

applyPngLut(LUTNight)

Dependencies (2)

Dev Dependencies (0)

    Package Sidebar

    Install

    npm i @monogrid/lut-loader

    Weekly Downloads

    3

    Version

    0.0.2

    License

    MIT

    Unpacked Size

    4 kB

    Total Files

    4

    Last publish

    Collaborators

    • daniele-pelagatti