Categorygithub.com/nurlantulemisov/imagecompression
modulepackage
0.0.0-20211028165702-e399758d3838
Repository: https://github.com/nurlantulemisov/imagecompression.git
Documentation: pkg.go.dev

# README

Go Coverage Status

SVD image compression

An implementation image compression using SVD decomposition on Go

Built With

Compression examples

Compress ratioImage
Original
Ratio 10%
Ratio 50%
Ratio 80%
Ratio 90%
Ratio 99%

Getting Started

To get a local copy up and running follow these simple steps.

Installation

Install vendor

go get -u github.com/nurlantulemisov/imagecompression

Simple usage

package main

import (
   compression "github.com/nurlantulemisov/imagecompression"
   "image/png"
   "log"
   "os"
)

func main() {
   file, err := os.Open("examples/simple_usage/tmp/test.png")

   if err != nil {
      log.Fatalf(err.Error())
   }

   img, err := png.Decode(file)

   if err != nil {
      log.Fatalf(err.Error())
   }
   
   compressing, _ := compression.New(95)
   compressingImage := compressing.Compress(img)

   f, err := os.Create("examples/simple_usage/tmp/compressed-test.png")
   if err != nil {
      log.Fatalf("error creating file: %s", err)
   }
   defer func(f *os.File) {
      err := f.Close()
      if err != nil {
         log.Fatalf(err.Error())
      }
   }(f)

   err = png.Encode(f, compressingImage)
   if err != nil {
      log.Fatalf(err.Error())
   }
}

Contributing

Contributions are what make the open source community such an amazing place to learn, inspire, and create. Any contributions you make are greatly appreciated.

  1. Fork the Project
  2. Create your Feature Branch (git checkout -b feature/AmazingFeature)
  3. Commit your Changes (git commit -m 'Add some AmazingFeature')
  4. Push to the Branch (git push origin feature/AmazingFeature)
  5. Open a Pull Request

Roadmap

  1. Compression of grayscale images
  2. Provide Frobenius norm

Contact

Tulemisov Nurlan - @NurlanTulemisov

Email - [email protected]

Project Link: https://github.com/nurlantulemisov/imagecompression

# Packages

No description provided by the author

# Functions

No description provided by the author

# Structs

ImageCompression provide service for compression image.Image.