0.0.25 • Published 10 months ago

@eepson123tw/canvas-meme v0.0.25

Weekly downloads
-
License
MIT
Repository
github
Last release
10 months ago

Canvas Meme Image

Canvas Meme Image is an npm package based on TypeScript and Vue that allows you to upload an image and convert it to text. This tool is particularly useful for generating image text, creating MEME images, or performing image processing.

Features

  • Upload images
  • Convert images to text
  • Easy-to-use interface
  • Developed with TypeScript and Vue

Installation

Install using npm or yarn:

npm install @eepson123tw/canvas-meme
# or
yarn add @eepson123tw/canvas-meme

props

PropertyTypeRequiredDefaultDescription
replaceContentstringYes"啊"The content that will replace certain pixels in the image.
fontSizenumberNo2The font size used for the replacement content on the canvas.
fontstringNo"monospace"The font style used for the replacement content on the canvas.
colorstringNoN/AThe color of the replacement content on the canvas.
radiusnumberNoN/AThe radius of the area affected by the replacement content.
sourcestringNoN/AThe source URL of an image to be loaded into the canvas initially.
canvasWidthnumberNo600The width of the canvas.
canvasHeightnumberNo400The height of the canvas.

Explanation of Props Interface

  • replaceContent: This is a string that will be used to replace certain pixels on the canvas. For example, it might replace pixels that meet a certain color threshold.
  • fontSize: An optional property specifying the size of the font used for the replacement content. If not provided, it defaults to 2.
  • font: An optional property specifying the font family to be used for the replacement content. The default value is "monospace".
  • color: An optional property that determines the color of the replacement content. If not specified, the default color will be used.
  • radius: An optional property that might be used to specify the radius of the area affected by the replacement content. This is not used in the current script but might be included for future enhancements.
  • source: An optional string that specifies the URL of an image to be initially loaded into the canvas. If provided, the image from this URL will be drawn on the canvas when the component mounts.
  • canvasWidth: An optional property that specifies the width of the canvas element. The default value is 600.
  • canvasHeight: An optional property that specifies the height of the canvas element. The default value is 400.

Usage

alt text

Contributing

We welcome contributions and issue reports. Please follow our contribution guidelines.

License

This project is licensed under the MIT License.

0.0.25

10 months ago

0.0.24

10 months ago

0.0.23

10 months ago

0.0.22

10 months ago

0.0.21

10 months ago

0.0.20

10 months ago

0.0.19

10 months ago

0.0.18

10 months ago

0.0.7

10 months ago