Giter Site home page Giter Site logo

gopic's Introduction

goPic package

I was fed up with Golang's photo-processing abilities, so I wrote goPic!It's like the PIL package in Python!

How To Install

go get -u github.com/jiayuqi7813/gopic

Example

package main

import (
	"fmt"
	"image/color"
	"github.com/jiayuqi7813/gopic"
)

func main() {
	filep := "j.png"
	pic := gopic.ImageFile(filep)
	w, h := pic.Size()
	fmt.Println(pic.Mode())
	newpic := gopic.NewPicFile(w, h, color.Palette{color.RGBA{}})
	for i := 0; i < w; i++ {
		for j := 0; j < h; j++ {
			rgb := pic.GetPixel(i, j)
			newpic.PutPixel(i, j, color.Palette{color.NRGBA{R: uint8(rgb[0]), G: uint8(rgb[1]), B: uint8(rgb[2]), A: 255}})
		}
	}
	newpic.Show()
}

image-20220814163819684

Welcome to use, and welcome to put forward issues, help our goPic better and better

License

GPL3.0

gopic's People

Contributors

jiayuqi7813 avatar

Stargazers

Tryanks avatar  avatar Strl avatar Yi Ran avatar SakuraiCora avatar Sherlock avatar Randark avatar 夜魅楠孩 avatar

Watchers

 avatar

gopic's Issues

Need Document

Why the README has only one example?
We need more info to use all this repo receiver.
Starred.

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.