fluxpoint.paths.imagegen

Module Contents

Classes

Square

Square Image class

Triangle

Triangle Image class

Circle

Circle Image class

ImageUrl

ImageUrl Image class

Text

Text class for custom image

ImageGenerator

Custome image generator Api endpoints documented in https://bluedocs.page/fluxpoint-api/imagegen

class fluxpoint.paths.imagegen.Square(width, height, color=None, round=None, x=None, y=None)[source]

Square Image class

Parameters:
  • width (int) – Set the width of the shape

  • height (int) – Set the height of the shape

  • color (Optional[str], optional) – Set the shape to be a color from name/hex/rgb/rgba use rgba for transparency, defaults to None

  • round (Optional[int], optional) – Make the borders of the shape round. (Default 0), defaults to None

  • x (Optional[int], optional) – Position the image in pixels, defaults to None

  • y (Optional[int], optional) – Position the image in pixels, defaults to None

__slots__ = ['width', 'height', 'color', 'round', 'x', 'y']
to_dict(self)[source]

Converts the class to a dictionary

Return type:

dict

class fluxpoint.paths.imagegen.Triangle(width, height, cut, color=None, x=None, y=None)[source]

Triangle Image class

Parameters:
  • color (Optional[str]) – Set the shape to be a color from name/hex/rgb/rgba use rgba for transparency

  • width (int) – Set the width of the shape

  • height (int) – Set the height of the shape

  • cut (Literal[topleft, topright, bottomleft, bottomright]) – Choose where the missing peice of the triangle is

  • x (Optional[int], optional) – Position the image in pixels, defaults to None

  • y (Optional[int], optional) – Position the image in pixels, defaults to None

__slots__ = ['width', 'height', 'cut', 'color', 'x', 'y']
to_dict(self)[source]

Converts the class to a dictionary

Return type:

dict

class fluxpoint.paths.imagegen.Circle(color=None, radius=None, x=None, y=None)[source]

Circle Image class

Parameters:
  • color (Optional[str]) – Set the shape to be a color from name/hex/rgb/rgba use rgba for transparency

  • radius (Optional[int]) – Set the size of the circle from the center point

  • x (Optional[int], optional) – Position the image in pixels, defaults to None

  • y (Optional[int], optional) – Position the image in pixels, defaults to None

__slots__ = ['color', 'radius', 'x', 'y']
to_dict(self)[source]

Converts the class to a dictionary

Return type:

dict

class fluxpoint.paths.imagegen.ImageUrl(url, cache=False, width=None, height=None, maxwidth=None, maxheight=None, round=None, x=None, y=None)[source]

ImageUrl Image class

Parameters:
  • url (str) – https://website.com/image.png

  • cache (Optional[bool], optional) – Cache the image server-side so it can be easily loaded again such as background images. (Not Recommended for Avatars), defaults to False

  • width (Optional[int], optional) – Set the width of the image, defaults to None

  • height (Optional[int], optional) – Set the height of the image, defaults to None

  • maxwidth (Optional[int], optional) – Set the max width so the image can scale properly, defaults to None

  • maxheight (Optional[int], optional) – Set the max height so the image can scale properly, defaults to None

  • round (Optional[int], optional) – Make the borders of the image round for stuff like circle avatars, defaults to None

  • x (Optional[int], optional) – Position the image in pixels, defaults to None

  • y (Optional[int], optional) – Position the image in pixels, defaults to None

__slots__ = ['url', 'cache', 'width', 'height', 'maxwidth', 'maxheight', 'round']
to_dict(self)[source]

Converts the class to a dictionary

Return type:

dict

class fluxpoint.paths.imagegen.Text(text, size=16, font='Sans Serif', color='white', back=None, x=0, y=0, align='l', bold=False, italics=False, underline=False, line=1.0, weight=500, width=None, height=None, outline=False, outlinewidth=9, outlinecolor='black', outlineblur=1)[source]

Text class for custom image

Parameters:
  • text (str) – Set the text

  • size (Optional[int], optional) – Set the font size of the text, defaults to 16

  • font (Optional[str], optional) – Set the font to use for the text, defaults to “Sans Serif”

  • color (Optional[str], optional) – Set the text color from name/hex/rgb/rgba use rgba for transparency, defaults to “white”

  • back (Optional[str], optional) – Set the background color for the text box from name/hex/rgb/rgba use rgba for transparency, defaults to None

  • x (Optional[int], optional) – Position the text in pixels, defaults to 0

  • y (Optional[int], optional) – Position the text in pixels, defaults to 0

  • align (Optional[Literal[l,m,r]], optional) – Align the text from left/center/right (Default left), defaults to “l”

  • bold (Optional[bool], optional) – Set the text to bold style, defaults to False

  • italics (Optional[bool], optional) – Set the text to italics style, defaults to False

  • underline (Optional[bool], optional) – Set the text to underline style, defaults to False

  • line (Optional[float], optional) – Set the text to underline style, defaults to 1.0

  • weight (Optional[int], optional) – Increase the boldness of the tex, defaults to 500

  • width (Optional[int], optional) – Set the max width of the text box before it wraps to a newline, defaults to None

  • height (Optional[int], optional) – et the max height of the text box to clip extra text, defaults to None

  • outline (Optional[bool], optional) – Show text outline with default options, defaults to False

  • outlinewidth (Optional[int], optional) – Set the outline size from the text, defaults to 9

  • outlinecolor (Optional[str], optional) – Set the outline color from name/hex/rgb/rgba use rgba for transparency, defaults to “black”

  • outlineblur (Optional[int], optional) – Make the outline transparency less visible for a cool effect, defaults to 1

__slots__ = ['text', 'size', 'font', 'color', 'back', 'x', 'y', 'align', 'bold', 'italics', 'underline',...
to_dict(self)[source]

Converts the class to a dictionary

Return type:

dict

class fluxpoint.paths.imagegen.ImageGenerator(api_token)[source]

Bases: fluxpoint.http.BaseHTTP

Custome image generator Api endpoints documented in https://bluedocs.page/fluxpoint-api/imagegen

Parameters:

api_token (str) –

__str__(self)[source]

Return str(self).

await test(self)[source]

Test the image generator

Returns:

The response from the server

Return type:

Union[Dict, io.IOBase]

await customimage(self, type, width, height, color, images=None, texts=None)[source]

Get the created image gen image.

Parameters:
  • type (Literal[bitmap, image]) – Image type

  • width (int) – Overall width of the image

  • height (int) – Overall height of the image

  • color (str) – Background colour of the image

  • images (Optional[List[Union[ImageUrl, Square, Triangle, Circle]]], optional) – The image(s) that you want to embed in image, defaults to []

  • texts (Optional[List[Text]], optional) – The text(s) that you want to embed in image, defaults to []

Returns:

The custom generated image bytes data

Return type:

Union[Dict, io.IOBase]