LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 10-14-2021, 07:03 PM   #1
Skaperen
Senior Member
 
Registered: May 2009
Location: WV, USA
Distribution: Xubuntu, Ubuntu, Slackware, Amazon Linux, OpenBSD, LFS (on Sparc_32 and i386)
Posts: 2,375
Blog Entries: 30

Rep: Reputation: 163Reputation: 163
programs that generate images


i have yet to see a single simple program in a common (comes builtin on major Linux distros) interpreted language that generates the pixels of an image and brings it up in its own window. i was most hoping for something in Python3.

edit 1:

ideally, i'd like to see Python code that actually does the pixel work, itself, instead of calling some library. or maybe the library, itself, if entirely coded in Python3 (no C/C++, that would be cheating). getting the image to display with some library commonly available for Python would be OK.

Last edited by Skaperen; 10-14-2021 at 07:12 PM.
 
Old 10-14-2021, 07:16 PM   #2
dugan
LQ Guru
 
Registered: Nov 2003
Location: Canada
Distribution: distro hopper
Posts: 10,188

Rep: Reputation: 4752Reputation: 4752Reputation: 4752Reputation: 4752Reputation: 4752Reputation: 4752Reputation: 4752Reputation: 4752Reputation: 4752Reputation: 4752Reputation: 4752
What, like fractint?
 
Old 10-15-2021, 06:23 AM   #3
boughtonp
Senior Member
 
Registered: Feb 2007
Location: UK
Distribution: Debian
Posts: 1,780

Rep: Reputation: 1456Reputation: 1456Reputation: 1456Reputation: 1456Reputation: 1456Reputation: 1456Reputation: 1456Reputation: 1456Reputation: 1456Reputation: 1456

What are you trying to do?

 
Old 10-15-2021, 09:35 AM   #4
EdGr
Member
 
Registered: Dec 2010
Location: California, USA
Distribution: I run my own OS
Posts: 726

Rep: Reputation: 345Reputation: 345Reputation: 345Reputation: 345
You may be looking for something that does not exist. Pixel code is written in C/C++ for good reason.
Ed
 
Old 10-15-2021, 03:57 PM   #5
dugan
LQ Guru
 
Registered: Nov 2003
Location: Canada
Distribution: distro hopper
Posts: 10,188

Rep: Reputation: 4752Reputation: 4752Reputation: 4752Reputation: 4752Reputation: 4752Reputation: 4752Reputation: 4752Reputation: 4752Reputation: 4752Reputation: 4752Reputation: 4752
OpenCV has Python bindings.
 
Old 10-16-2021, 02:09 AM   #6
Skaperen
Senior Member
 
Registered: May 2009
Location: WV, USA
Distribution: Xubuntu, Ubuntu, Slackware, Amazon Linux, OpenBSD, LFS (on Sparc_32 and i386)
Posts: 2,375

Original Poster
Blog Entries: 30

Rep: Reputation: 163Reputation: 163
> What, like fractint?

what language is that written in? i thought it was originally in assembler and now in C.


> What are you trying to do?

make a choice about which GUI library in Python will serve my needs, especially the main loop functionality.


> You may be looking for something that does not exist. Pixel code is written in C/C++ for good reason.

possibly true. i know Python gets used for lots of GUI things. maybe one of them needed to work with pixels. if they used C/C++ for that part, that's the kind of thing i wanted to see. i do know how to do bit manipulations in Python. there may be tools to do this and someone may be using them.


> OpenCV has Python bindings.

that could be what programmers use. if so, i want to see a Python program using it.
 
Old 10-16-2021, 02:22 AM   #7
Skaperen
Senior Member
 
Registered: May 2009
Location: WV, USA
Distribution: Xubuntu, Ubuntu, Slackware, Amazon Linux, OpenBSD, LFS (on Sparc_32 and i386)
Posts: 2,375

Original Poster
Blog Entries: 30

Rep: Reputation: 163Reputation: 163
> What are you trying to do? (linked to a web page about The XY Problem).

there is a good reason that justifies asking about Y (and X and Z and so on). that is when evaluating different approaches to solving a problem. i don't want some else to decide for me. i just want to know about many solutions (if there are many) and eventually make the decision or let my boss do so.
 
Old 10-16-2021, 03:54 AM   #8
NevemTeve
Senior Member
 
Registered: Oct 2011
Location: Budapest
Distribution: Debian/GNU/Linux, AIX
Posts: 4,224
Blog Entries: 1

Rep: Reputation: 1585Reputation: 1585Reputation: 1585Reputation: 1585Reputation: 1585Reputation: 1585Reputation: 1585Reputation: 1585Reputation: 1585Reputation: 1585Reputation: 1585
It is not clear what your Y-problem is either.
 
Old 10-16-2021, 08:43 AM   #9
boughtonp
Senior Member
 
Registered: Feb 2007
Location: UK
Distribution: Debian
Posts: 1,780

Rep: Reputation: 1456Reputation: 1456Reputation: 1456Reputation: 1456Reputation: 1456Reputation: 1456Reputation: 1456Reputation: 1456Reputation: 1456Reputation: 1456

What NevemTeve says - I couldn't make sense of what you're asking, and now that I possibly have a slight inkling, that doesn't change my response - context is important.

Did you read the "What to do about it?" section of that link? Specifically point 3?

It's not about asking about X instead of Y - it's a matter of giving detail: showing enough of your working to get people on the same page as you, so they understand what is being asked and can provide more relevant answers.

There's no issue with saying "I'm trying to evaluate different options for doing <X> and would prefer an something that uses <method Y> because <reason>; everyone else seems to solve <X> with <Z> but <problem with Z> so I want this thread to focus on <Y>"

Especially when trying to decide between different options, this provides people with the relevant information to suggest the available solutions - it doesn't change that you get the final choice in which advice to follow/ignore.

 
1 members found this post helpful.
Old 10-16-2021, 03:45 PM   #10
Skaperen
Senior Member
 
Registered: May 2009
Location: WV, USA
Distribution: Xubuntu, Ubuntu, Slackware, Amazon Linux, OpenBSD, LFS (on Sparc_32 and i386)
Posts: 2,375

Original Poster
Blog Entries: 30

Rep: Reputation: 163Reputation: 163
i am the kind of person that understands things by example. i believe examples of usage will help me understand the capabilities of various GUI libraries that could be my choices in Python. thus i have been looking around for examples. everything i find, so far, either does not work with image pixel data, or ends up in C to display images. as EdGr points out, this may not exist. based on my search so far. i can believe that. i also believe my search is not, yet, exhaustive. what i am seeking, in this thread, are contradictory examples.
 
Old 10-16-2021, 05:45 PM   #11
boughtonp
Senior Member
 
Registered: Feb 2007
Location: UK
Distribution: Debian
Posts: 1,780

Rep: Reputation: 1456Reputation: 1456Reputation: 1456Reputation: 1456Reputation: 1456Reputation: 1456Reputation: 1456Reputation: 1456Reputation: 1456Reputation: 1456

On the contrary, I'm fairly certain every Python GUI library worth considering has the means to read and write pixel data, without you having to know or care about C. (Their behind the scenes implementation may use C/C++ but that's entirely irrelevant.)

Examples for any of them is a trivial search away, so either you're searching for completely the wrong terms, or your needs are more complex than "GUI library in Python ... work with image pixel data" and need to be better explained.

 
Old 10-16-2021, 07:24 PM   #12
EdGr
Member
 
Registered: Dec 2010
Location: California, USA
Distribution: I run my own OS
Posts: 726

Rep: Reputation: 345Reputation: 345Reputation: 345Reputation: 345
Skaperen - check out Cairo, a powerful 2D drawing library. It even has Python bindings.

Your program should call Cairo's drawing primitives whenever possible. If your program must draw pixels, Cairo provides an image surface to draw on. Be aware that using Cairo's drawing primitives will be faster than drawing pixels yourself.
Ed
 
Old 10-17-2021, 02:46 PM   #13
dugan
LQ Guru
 
Registered: Nov 2003
Location: Canada
Distribution: distro hopper
Posts: 10,188

Rep: Reputation: 4752Reputation: 4752Reputation: 4752Reputation: 4752Reputation: 4752Reputation: 4752Reputation: 4752Reputation: 4752Reputation: 4752Reputation: 4752Reputation: 4752
Quote:
Originally Posted by Skaperen View Post
> OpenCV has Python bindings.

that could be what programmers use. if so, i want to see a Python program using it.
So google for OpenCV Python examples? LOL? I could do that for you, but why?
 
Old 10-17-2021, 03:00 PM   #14
John VV
LQ Muse
 
Registered: Aug 2005
Location: A2 area Mi.
Posts: 17,531

Rep: Reputation: 2622Reputation: 2622Reputation: 2622Reputation: 2622Reputation: 2622Reputation: 2622Reputation: 2622Reputation: 2622Reputation: 2622Reputation: 2622Reputation: 2622
not in python but in c++
there is Gmic

a 100 % code generated image
Attached Thumbnails
Click image for larger version

Name:	Screenshot_20211017_145804.jpg
Views:	11
Size:	220.8 KB
ID:	37495  
 
Old 10-18-2021, 08:21 PM   #15
Skaperen
Senior Member
 
Registered: May 2009
Location: WV, USA
Distribution: Xubuntu, Ubuntu, Slackware, Amazon Linux, OpenBSD, LFS (on Sparc_32 and i386)
Posts: 2,375

Original Poster
Blog Entries: 30

Rep: Reputation: 163Reputation: 163
Quote:
Originally Posted by boughtonp View Post
Did you read the "What to do about it?" section of that link? Specifically point 3?
there is an absence of solutions meeting my needs. i have avoided code in C/C++/Java as not useful. i have avoided code that does not manipulate pixels. an example that does is one that loads an image file and changes some pixels before displaying in the window it is working. this could be the image of a house with a backgroundd name of the seller or real estate agent added.

Quote:
Originally Posted by boughtonp View Post
There's no issue with saying "I'm trying to evaluate different options for doing <X> and would prefer an something that uses <method Y> because <reason>; everyone else seems to solve <X> with <Z> but <problem with Z> so I want this thread to focus on <Y>"
i suppose the method you refer to here could be the language. the problem with Z is that these solutions do not apply to X, where Z is C and X is Python3.

Quote:
Originally Posted by boughtonp View Post
Especially when trying to decide between different options, this provides people with the relevant information to suggest the available solutions - it doesn't change that you get the final choice in which advice to follow/ignore.
i am looking for how this is done in Python3 rather than C/C++ because the memory model, how pixel data might be commonly worked with, including how manipulated with the code. a program that just reads a file and displays it will show a choice of the way the library is used to get pixels in the same way the display library can handle it. these libraries may even support multiple formats in common. the requirement to manipulate pixels constrains this to using a data format with direct access to the pixels. if the program manipulated the pixels via a library call or option (like a option to add a border) then i would rule that out because the format may not be raw pixels. OTOH, if it reads the file in NETPPM (regardless how stored in the file) format in Python3 and displays that, it is likely good enough.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
LXer: How to generate a animated GIF or movie out of images on Linux LXer Syndicated Linux News 0 11-19-2015 08:41 PM
Cookies in PHP where resized images generate on the fly each time source is read? ziphem Linux - General 0 02-15-2014 04:44 AM
How to Generate MD5SUMS.sign files while uploading ISO images kushalkoolwal Linux - Security 2 07-06-2008 12:30 PM
C++/SDL: Images moving too slowly. Images loaded once, etc. Why? RHLinuxGUY Programming 2 05-26-2007 06:11 PM
Convert cd images to dvd images rcsuk Debian 2 07-11-2005 11:34 AM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 04:48 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration