Code Monkey home page Code Monkey logo

rusty-image-proxy's Introduction

Hi ๐Ÿ‘‹, I'm Divyendu Singh

Full Stack + Mobile Developer/Product Designer

divyenduz

divyenduz

divyenduz

Connect with me:

divyenduz

Languages and Tools:

amplify android appwrite aws azure babel bash cockroachdb cplusplus css3 docker elasticsearch express figma firebase gcp git go graphql heroku html5 ifttt javascript jest kubernetes linux nextjs nginx nodejs postgresql postman puppeteer react reactnative redis rust sqlite typescript webpack zapier

divyenduz

ย divyenduz

divyenduz

rusty-image-proxy's People

Stargazers

 avatar  avatar

Watchers

 avatar  avatar

rusty-image-proxy's Issues

Confiugration

Make these configurable (+ environment variables support)

  • bind to 0.0.0.0
  • port

Code improvements

I asked for a code-review in the #beginners channel in the Rust discord and I got it

CleanShot 2020-01-18 at 23 46 41@2x

Don't write to the file system

I couldn't find an API yet to convert a DynamicImage from image-rs to stream-able bytes. So, I write to the file system and read the bytes from the file to stream the image.

I am looking for an equivalent of image::load_from_memory(https://docs.rs/image/0.23.0-preview.0/image/fn.load_from_memory.html) for writing. Something like image::write_to_memory.

I tried digging into how save encodes an image and ran into this write_to function. It looks like save finds the file format with a match and encodes it to write to the specified path. Maybe, there is an API to do that to a buffer that I am not aware of.

Related issues:

image-rs/image#982
image-rs/image#834
image-rs/image#827

P.S. This looks like my answer, the write_to that I ran into is actually available on the DynamicImage object.

Expose more features with get parameters

Originally, I made this for a very specific need of the https://readbot.app project. I just needed to grayscale images (no color on kindle's e-ink display yet) and scale them down to 600 pixels width because I wanted to reduce the size.

But this project can be expaneded to expose image-rs (what a beautiful project ๐ŸŽ‰) with a web interface.

This can be done by exposing the image processing functions as GET parameters. I can think if this being the supported API:

Function Get Parameters Type Default Status
blur blur float (sigma) 0.0 Not Implemented
brighten brighten int 0 Not Implemented
huerotate huerotate int 0 Not Implemented
contrast contrast float 0.0 Not Implemented
crop (crop_x, crop_y, crop_width, crop_height) (int, int, int, int) (0, 0, original_width, original_height) Not Implemented, if any parameter is supplied, use defaults for others, else don't crop
filter3x3 ? ? Not Implemented, I have no idea what this is
flip_horizontal fliph boolean false Not Implemented
flip_vertical flipv boolean false Not Implemented
grayscale grayscale boolean false Currently: hardcoded to always grayscale
invert invert boolean false Not Implemented
resize (width, height, filter?) (int, int, ?) (?, ?, ?) Currently: Harcoded to cap the width at 600. Need to figure out the potential API values for filters.
rotate90 rotate90 boolean false Not Implemented
rotate180 rotate180 boolean false Not Implemented
rotate270 rotate270 boolean false Not Implemented
unsharpen (unsharpen_sigma, unsharpen_threshold) (float, int) (0.0, 0) Not Implemented

Legend:

  • ? indicates that I don't know anything about that and can't make a decision yet (If you know, please feel free to change it via a PR).
  • Everything else is where I know something, just enough to make a first wild guess. By no means it means that I know a lot about that image processing function.
  • (x, y) is a tuple representing multiple get parameters or their types or values

Formats

Support image formats other than png

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.