Let the apes out and free them from backgrounds. With the goal to bring them to context.
Create transparent background
require 'masked_ape_club'
id = #your ape id
a = MaskedApeClub::Load.new()
a.load( id: id )
a.mask()
a.write( path: 'test.png' )
Censor your ape
require 'masked_ape_club'
id = #your ape id
a = MaskedApeClub::Load.new()
a.load( id: id )
a.censored()
a.write( path: 'test.png' )
Go on holiday with your ape!
require 'masked_ape_club'
id = #your ape id
a = MaskedApeClub::Load.new()
a.load( id: id )
a.mask()
background = 'background.png'
blob = open( background ).read()
a.background( blob: blob )
a.write( path: 'test.png' )
- Quickstart
- Setup
- Methods
- Contributing
- Limitations
- Credits
- License
- Code of Conduct
- Support my Work
gem install masked_ape_club
require 'masked_ape_club'
id = #your ape id
a = MaskedApeClub::Load.new()
a.load( id: id )
a.mask_ape( id: id)
a.write( path: 'your_ape.png' )
Add this line to your application's Gemfile:
gem 'masked_ape_club'
And then execute:
$ bundle install
Or install it yourself as:
$ gem install masked_ape_club
On Rubygems:
.load( id: )
require 'masked_ape_club'
id = #your ape id
a = MaskedApeClub::Load.new()
a.load( id: id )
a.write( path: 'test.png' )
Input
Key | Type | Required | Example | Description |
---|---|---|---|---|
:id | String |
Yes | your ape number | Choose your ape. |
Return
True
.mask( fuzz: '1%', position: 1500, radius: 25 )
require 'masked_ape_club'
id = #your ape id
a = MaskedApeClub::Load.new()
a.load( id: id )
a.mask()
a.write( path: 'test.png' )
Input
Key | Type | Required | Example | Description |
---|---|---|---|---|
:fuzz | String |
No | "1%" | Choose threshold for erasing background, dont forget "%" |
:position | Integer |
No | 1500 | Set pixel index which represent the background color. Every Image has 631x631 Pixels, 1500 should be near on the left right in row 3. |
:size | Integer |
No | 2 | Draws a small frame arround the image, for better result on keying the background. |
Return
True
.censored( upper_left_x: 240, upper_left_y: 210, lower_right_x: 460, lower_right_y: 270, color: 'black' )
require 'masked_ape_club'
id = #your ape id
a = MaskedApeClub::Load.new()
a.load( id: id )
a.censored()
a.write( path: 'test.png' )
Input
Key | Type | Required | Example | Description |
---|---|---|---|---|
:upper_left_x | Integer |
No | 240 | Set rectangle coordinate. |
:upper_left_y | Integer |
No | 210 | Set rectangle coordinate. |
:lower_right_x | Integer |
No | 460 | Set rectangle coordinate. |
:lower_right_y | Integer |
No | 270 | Set rectangle coordinate. |
:color | Integer |
No | 'black' | Set background color of rectangle |
Return
True
.background( blob:, gravity: Magick::CenterGravity, offset_x: 0, offset_y: 0, width: 631, height: 631)
require 'masked_ape_club'
id = #your ape id
a = MaskedApeClub::Load.new()
a.load( id: id )
a.mask()
background = 'background.png'
blob = open( background ).read()
a.background( blob: blob )
a.write( path: 'test.png' )
Input
Key | Type | Required | Example | Description |
---|---|---|---|---|
:blob | String |
Yes | Set rectangle coordinate. | |
:gravity | RMagick Constant |
No | 210 | See RMagick documentation for details: RMagick Gravity |
:offset_x | Integer |
No | 0 | Offset ape on the x axes. |
:offset_y | Integer |
No | 0 | Offset ape on the y axes. |
:width | Integer |
No | 631 | Set default canvas width |
:height | Integer |
No | 631 | Set default canvas height |
Return
True
Bug reports and pull requests are welcome on GitHub at https://github.com/a6b8/masked-ape-club-for-ruby. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the code of conduct.
- Only tested with some ape
The gem is available as open source under the terms of the MIT License.
Everyone interacting in the masked-ape-club-for-ruby project's codebases, issue trackers, chat rooms and mailing lists is expected to follow the code of conduct.
Please ⭐️ star this Project, every ⭐️ star makes us very happy!