Skip to content

Commit

Permalink
Add documentation to reflect package changes
Browse files Browse the repository at this point in the history
- Document changes in writing text, color count and image saving
  • Loading branch information
MarvinKweyu committed Aug 13, 2020
1 parent ae79c9f commit 9e09f45
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 3 deletions.
Binary file added docs/_static/out_random_string.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
29 changes: 27 additions & 2 deletions docs/colordetect.rst
Original file line number Diff line number Diff line change
Expand Up @@ -59,11 +59,14 @@ Look up :ref:`get_color_count<get_color_count>` for details
on the different arguments it accepts including the different color format return values.
Now suppose you want to take it a step further and write the result to the image itself.

.. warning:: Take note of the difference in saving the image to storage from hte previous
`save_color_count<save_color_count>` to `save_image<save_color_count>`
::

my_image.save_color_count("<path_to_save_image>", "<name_of_image>")
>>> my_image.write_color_count()
>>> my_image.save_image("<path_to_save_image>", "<name_of_image>")

The :ref:`save_color_count<save_color_count>` method will accept , as optional parameters, the path and name of the image with color count on it.
Just as `save_color_count`, :ref:`save_image<save_color_count>` will accept , as optional parameters, the path and name of the image with color count on it.
By default, these values are ``.`` (For the current directory the script is being run from)
and ``out.jpg`` respectively.

Expand All @@ -80,3 +83,25 @@ As a similar example, with colors represented in their hex format,

.. image:: _static/out_hex.jpg


Additionally, to enable the use of custom text on an image:

::

>>> import ColorDetect
>>> my_image = ColorDetect("<image_path>")
>>> my_image.write_text(text="a random string", line_spacing=10)


.. image:: _static/out_random_string.jpg


Here, `line_spacing` would be the space between the lines, depending on how many characters are
input, you want. By default, this value is an integer, zero, `0`, denoted as values on the Y axis scale

Whether using `write_text` or `write_color_count`, the image has to be saved using `save_image`.

Interested to see just how far you can go? Take a look at :ref:`Contribution guidelines<Contributing>`.

`ColorDetect <https://github.com/MarvinKweyu/ColorDetect>`_ is always looking for the next step.

4 changes: 3 additions & 1 deletion docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
author = 'Marvin Kweyu'

# The full version, including alpha/beta/rc tags
release = '0.1.7'
release = '0.2.0'

# -- General configuration ---------------------------------------------------

Expand Down Expand Up @@ -56,6 +56,8 @@
#
html_theme = 'alabaster'

html_logo = '../img/ColorDetect.png'

html_theme_options = {
'description': "Recognize and identify different colors in an image.",
'logo_text_align': 'justify',
Expand Down

0 comments on commit 9e09f45

Please sign in to comment.