Code Monkey home page Code Monkey logo

04-bitmap's Introduction

CF Lab 04: Bitmap Transformer

Submission Instructions

  • Work in a fork of this repository
  • Work in a branch on your fork
  • Write all of your code in a directory named lab- + <your name> e.g. lab-susan
  • Open a pull request to this repository
  • Submit on canvas a question and observation, how long you spent, and a link to your pull request

Resources

Configuration

Configure the root of your repository with the following files and directories. Thoughtfully name and organize any additional configuration or module files.

  • README.md - contains documentation
  • .gitignore - contains a robust .gitignore file
  • .eslintrc - contains the course linter configuratoin
  • .eslintignore - contains the course linter ignore configuration
  • package.json - contains npm package config
    • create a lint script for running eslint
    • create a test script for running tests
  • lib/ - contains module definitions
  • __test__/data/ - contains bitmaps for testing
  • __test__/ - contains unit tests

Feature Tasks

For this assignment, you will be building a bitmap (.bmp) transformer CLI. It will read a bitmap in from disk, run one or more color or raster transforms and then write it out to a new file. This project will require the use of node buffers in order to manipulate binary data. Your solution should be composed of small tested modules that solve specific problems. Your modules should be thoughtfully named and well documented. The entry point to your CLI should be an index.js file in the root of your application, and all helper modules should be placed in the lib/ directory. Your bitmap transformer modules should not use any third party libraries.

Minimum Requirements
  • The CLI should be architected using best modularization practices
  • The CLI should require at least three arguments input-file-path output-file-path transfrom-name
  • The CLI should support a minimum of three transforms
  • The CLI should log useful Error messages if used incorrectly
  • The CLI should log a success message on completion

Testing

  • Use describe and it methods to define descriptive tests and increase readability
  • Each it callback should aim to test a small, well defined, feature of a function
  • Write tests to ensure that each function behaves correctly with valid and invalid inputs
  • Note: The CLI should be tested without using child_process or any equivalent third party libraries

Documentation

In your README.md, describe the exported values of each module you have defined. Every function description should include it's airty (expected number of parameters), the expected data for each parameter (data-type and limitations), and it's behavior (for both valid and invalid use). Feel free to write any additional information in your README.md that you deem relavent.

Tips

You will want to define a strategy for solving the problem before you begin to code. Once you have a strategy defined, you can break it into steps that can be split into helper modules. Each helper module should solve a small specific problem. The main module should utilize the helper modules to execute your original stratagy.

Example Strategy
  1. Gather user input (infile, outfile, and transform)
  2. Read the input bitmap file using the fs module
  3. Parse the bitmap's buffer into an object representing a bitmap (using a constructor)
  4. Using metadata from the parsed bitmap object, run a transform on the buffer directly (mutate the color or raster data)
  5. Write the mutated buffer to the output file path
Transfrom Ideas
  • Color Pallet Transforms

    • Invert
    • Randomize
    • Black and White
    • Darken or Lighten
    • Add or Mutiply a Hue
    • Add or Subtract Contrast
  • Raster Data Transforms

    • Pixilate
    • Add a Border
    • Add a Watermark
    • Vertically or Horizontally Flip
    • Vertically or Horizontally Mirror
    • Vertically or Horizontally Stretch

04-bitmap's People

Contributors

nicoleweese avatar nords3x4 avatar ahmedali93 avatar nordcoder0101 avatar bnates avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.