Python Programing from Jupyter Notebook
How to Generate RGB Image in Python Programing Language from Jupyter Notebook
Sometimes you want to generate a simple product (especially for coding beginners), so let’s start generating our own RGB Images:
- Our Generate RGB Image Python Code consists of 7 steps:
1. step-1: We import python libraries to be used.
2. step-2: We define the image size in the dimensions we want — height, width and depth.
3. step-3: Define the basic colors Red, Green, Blues using the RGB Color Model -for each- 0 to 255.
4. step-4: Create RGB Numpy Array from defined R, G, B base colors using height and width.
5. step-5: We show RGB Image from array with Matplotlib.
What Are Some Technical Information and Technical Terms?
1–Defining RGB Color Model[¹]
4–Defining Python Programing Language[⁴]
5–Defining Jupyter Notebook[⁵]
1–2 Defining RGB Color Model[¹] & Defining Image[²]
The RGB color model is an additive color model in which the red, green, and blue primary colors of light are added together in various ways to reproduce a broad array of colors. The name of the model comes from the initials of the three additive primary colors, red, green, and blue.
An image (from Latin: imago) is an artifact that depicts visual perception, such as a photograph or other two-dimensional picture, that resembles a subject — usually a physical object — and thus provides a depiction of it.
- A uint8 data type contains all whole numbers from 0 to 255. As with all unsigned numbers, the values must be non-negative. Uint8’s are mostly used in graphics.
class numpy.ubyte: Unsigned integer type Alias on this platform (Linux x86_64)
numpy.uint8: 8-bit unsigned integer (
There are 5 basic numerical types:
1. representing booleans (bool),
2. integers (int),
3. unsigned integers (uint)
4. floating point (float)
Those with numbers in their name indicate the bitsize of the type (i.e. how many bits are needed to represent a single value in memory). Some types, such as
intp, have differing bitsizes, dependent on the platforms (e.g. 32-bit vs. 64-bit machines). This should be taken into account when interfacing with low-level code (such as C or Fortran) where the raw memory is addressed.
4–Defining Python Programing Language[⁴] from Own Website?
- Python For Beginners | Python.org
Welcome! Are you completely new to programming? If not then we presume you will be looking for information about why and how to get started with Python. Fortunately an experienced programmer in any programming language (whatever it may be) can pick up Python very quickly. It’s also easy for beginners to use and learn, so jump in!
Installing Python is generally easy, and nowadays many Linux and UNIX distributions include a recent Python. Even some Windows computers (notably those from HP) now come with Python already installed. If you do need to install Python and aren’t confident about the task you can find a few notes on the BeginnersGuide/Download wiki page, but installation is unremarkable on most platforms.
Before getting started, you may want to find out which IDEs and text editors are tailored to make Python editing easy, browse the list of introductory books, or look at code samples that you might find helpful.
There is a list of tutorials suitable for experienced programmers on the BeginnersGuide/Tutorials page. There is also a list of resources in other languages which might be useful if English is not your first language.
The online documentation is your first port of call for definitive information. There is a fairly brief tutorial that gives you basic information about the language and gets you started. You can follow this by looking at the library reference for a full description of Python’s many libraries and the language reference for a complete (though somewhat dry) explanation of Python’s syntax. If you are looking for common Python recipes and patterns, you can browse the ActiveState Python Cookbook
5–Defining Jupyter Notebook[⁵]
Free software, open standards, and web services for interactive computing across all programming languages.
— Jupyter Notebook: The Classic Notebook Interface.
The Jupyter Notebook is the original web application for creating and sharing computational documents. It offers a simple, streamlined, document-centric experience.
Useful Links & Resources:
[¹]RGB color model — Wikipedia (wikipedia.org)
[²]Image — Wikipedia (wikipedia.org)
[³]Int Ranges — UInt8: [0:127]| Numpy Data Types
[⁴]Welcome to Python.org
[⁵]Project Jupyter | Home
Have a nice Day, Folks.
My first post, and I just started writing in Medium. if possible, can you follow my medium account.
thanks for support & giving time.