Skip to main content

This is a module that can turn a picture into a pattern of letters and symbols.

Project description

photototext module is built on the basis of PIL and Numpy. It is simple and has only one function: change. It can open all kinds of pictures such as jpg, png, gif and so on that are supported by PIL. Then it will change the picture into a graph composed of characters and signs. Finally, the result will be returned as a string type. The introduction to this function change is as follows:

Function change has one parameter: file. It can automatically compress the change the picture once the path of the picture has been input to file. The result is a new graph composed of characters and signs.

For example, there is a jpg type of logo picture of Python at D(D:\python.jpg). The changing of the picture can be realized by typing:

import photototext as pt

text = pt.change('D:\python.jpg')

print(text)

The result is as follow:

                                                                                      ...;;;---------;;;;..                                                                                         
                                                                              .;-:!>>77??????CCCCCCCC??????77>>!:-;.                                                                                
                                                                        .;-!>7??CCCC??????????????????????????CCCC??7>!-;                                                                           
                                                                     ;:>7?CC??????????????????????????????????????????CC?7>:;                                                                       
                                                                  ;!7?C???????????????????????????????????????????????????CC?7:;                                                                    
                                                               .:7?C??????????????????????????????????????????????????????????C?>-                                                                  
                                                              -7C???????CC????CC????????????????????????????????????????????????CC7;                                                                
                                                             >C???????C7!-;;;;-!7C??????????????????????????????????????????????????:                                                               
                                                            >C????????:.        .:??????????????????????????????????????????????????C:                                                              
                                                           -C????????-            -???????????????????????????????????????????????????.                                                             
                                                           :C???????7              >?????????????????????????????????????????????????C-                                                             
                                                           :C????????.            .7?????????????????????????????????????????????????C-                                                             
                                                           :C????????>.          .>??????????????????????????????????????????????????C-                                                             
                                                           :C?????????7:;      .:7C??????????????????????????????????????????????????C-                                                             
                                                           :C??????????C?7>!!>7?C????????????????????????????????????????????????????C-                                                             
                                                           !C?????????????CCCC???????????????????????????????????????????????????????C-                                                             
                                                           :C????????????????????????????????????????????????????????????????????????C-                                                             
                                                           !C????????????????????????????????????????????????????????????????????????C-                                                             
                                                           :?77777777777777777777777777777777777?????????????????????????????????????C-                                                             
                                                            ................................... -????????????????????????????????????C-                                                             
                                                                                                -C???????????????????????????????????C-                                                             
                                .;:!!>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>7????????????????????????????????????C-   .;;;;;;;;;;;;;;;;;;;;..                                   
                              ->??CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC?????????????????????????????????????C-   ;:----------------------;.                                
                            :7C??????????????????????????????????????????????????????????????????????????????????????????????????????C-   ;--------------------------.                              
                          -7C????????????????????????????????????????????????????????????????????????????????????????????????????????C-   ;---------------------------;.                            
                         !????????????????????????????????????????????????????????????????????????????????????????????????????????????;   ;-----------------------------.                           
                        >C????????????????????????????????????????????????????????????????????????????????????????????????????????????;   ;------------------------------;                          
                       >C?????????????????????????????????????????????????????????????????????????????????????????????????????????????;   ;-------------------------------;                         
                      !C??????????????????????????????????????????????????????????????????????????????????????????????????????????????.   ;--------------------------------.                        
                     :C??????????????????????????????????????????????????????????????????????????????????????????????????????????????7.   ;---------------------------------.                       
                    .???????????????????????????????????????????????????????????????????????????????????????????????????????????????C!    ;----------------------------------                       
                    !C???????????????????????????????????????????????????????????????????????????????????????????????????????????????.    -----------------------------------;                      
                   ;????????????????????????????????????????????????????????????????????????????????????????????????????????????????-    ;------------------------------------                      
                   !C??????????????????????????????????????????????????????????????????????????????????????????????????????????????-    ;-------------------------------------.                     
                   7????????????????????????????????????????????????????????????????????????????????????????????????????????????C>.    ;--------------------------------------;                     
                  ;???????????????????????????????????????????????????????????????????????????????????????????????????????????C7:    .-----------------------------------------                     
                  :C???????????????????????????????????????????????????????????????????????????????????????????????????????C?>:     ;------------------------------------------.                    
                  !C????????????????????????????????????????????????????????????????????????????????????????CCCCC?C?CCCC??>:;     ;--------------------------------------------.                    
                  >C?????????????????????????????????????????????????CCC???7777777777777777777777777>>>>>>>>>>>>>>>>>!!:;.     .;----------------------------------------------;                    
                  >??????????????????????????????????????????????CC?7!:-;...                                                .;;------------------------------------------------;                    
                  >????????????????????????????????????????????C?>-.                                                 ....;;----------------------------------------------------;                    
                  >???????????????????????????????????????????7:.     ..;;-----------------------------------------------------------------------------------------------------;                    
                  !????????????????????????????????????????C7-     .;----------------------------------------------------------------------------------------------------------.                    
                  :C???????????????????????????????????????:    .;-------------------------------------------------------------------------------------------------------------.                    
                  ;??????????????????????????????????????7;    ;---------------------------------------------------------------------------------------------------------------                     
                   7????????????????????????????????????7.   .----------------------------------------------------------------------------------------------------------------;                     
                   !C???????????????????????????????????;   .-----------------------------------------------------------------------------------------------------------------.                     
                   .???????????????????????????????????7    ------------------------------------------------------------------------------------------------------------------                      
                    !C????????????????????????????????C>   .-----------------------------------------------------------------------------------------------------------------.                      
                    .?????????????????????????????????C!   .-----------------------------------------------------------------------------------------------------------------                       
                     -?????????????????????????????????!   .----------------------------------------------------------------------------------------------------------------.                       
                      !C??????????????????????????????C!   .---------------------------------------------------------------------------------------------------------------.                        
                       >C?????????????????????????????C!   ;--------------------------------------------------------------------------------------------------------------;                         
                        !C????????????????????????????C!   ;-------------------------------------------------------------------------------------------------------------;                          
                         :????????????????????????????C:   ;------------------------------------------------------------------------------------------------------------.                           
                          ;7C?????????????????????????C:   ;----------------------------------------------------------------------------------------------------------;.                            
                            -7CC???????????????????????:   ;--------------------------------------------------------------------------------------------------------;.                              
                              ->7?CCCCCCCCCCCCCCCCCCC?C!   ;------------------------------------------------------------------------------------------------------;.                                
                                .;-:!!>>>>>>>>>>>>>>>>>-   ;-------------------------------------;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;..                                   
                                                           ;-------------------------------------                                                                                                   
                                                           ;-------------------------------------                                                                                                   
                                                           ;--------------------------------------------------------------------------.                                                             
                                                           ;--------------------------------------------------------------------------.                                                             
                                                           ;--------------------------------------------------------------------------.                                                             
                                                           ;--------------------------------------------------------------------------.                                                             
                                                           ;-------------------------------------------------------;;;;;--------------.                                                             
                                                           ;----------------------------------------------------;.       .;-----------.                                                             
                                                           ;---------------------------------------------------;            ----------.                                                             
                                                           ;--------------------------------------------------;             .---------.                                                             
                                                           ;--------------------------------------------------;              ---------.                                                             
                                                           .---------------------------------------------------.            ;---------.                                                             
                                                            ;---------------------------------------------------.         .;---------;                                                              
                                                             ;----------------------------------------------------;;....;;----------;                                                               
                                                              .--------------------------------------------------------------------.                                                                
                                                                .---------------------------------------------------------------;.                                                                  
                                                                  .;----------------------------------------------------------;.                                                                    
                                                                     .;;--------------------------------------------------;..                                                                       
                                                                         ..;;----------------------------------------;;..                                                                           
                                                                               ...;;;------------------------;;;...                                                                                 
                                                                                         ................                                                                                           

Note: The graphics you see may be distorted,use “宋体” of “Terminal” fonts to see the result.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

photototext-0.1.2.tar.gz (4.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

photototext-0.1.2-py3-none-any.whl (4.2 kB view details)

Uploaded Python 3

File details

Details for the file photototext-0.1.2.tar.gz.

File metadata

  • Download URL: photototext-0.1.2.tar.gz
  • Upload date:
  • Size: 4.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/46.1.3 requests-toolbelt/0.9.1 tqdm/4.44.1 CPython/3.8.1

File hashes

Hashes for photototext-0.1.2.tar.gz
Algorithm Hash digest
SHA256 94905cc53fa48ff02b6d281d8595acfed9a8eee6ff7c1b938a0905d590cc5cce
MD5 60ec79f86bde38dceb1f4e9d382d2434
BLAKE2b-256 e9957079786c1307ab719cf3388e330754cb3cdcadad552c3c1c0f7950347b95

See more details on using hashes here.

File details

Details for the file photototext-0.1.2-py3-none-any.whl.

File metadata

  • Download URL: photototext-0.1.2-py3-none-any.whl
  • Upload date:
  • Size: 4.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/46.1.3 requests-toolbelt/0.9.1 tqdm/4.44.1 CPython/3.8.1

File hashes

Hashes for photototext-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 55a30c8175c53ef2490f3d3524708bec756b396854ac474ac3bb22fd95748081
MD5 acda639f1aca13321d6ae46bb3fd85a8
BLAKE2b-256 8e298db46ca7798d051c5c5a6bb4eca09072c3ea2eda804a1150ad502d3aa1f3

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page