LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
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, 06:03 PM   #1
Skaperen
Senior Member
 
Registered: May 2009
Location: center of singularity
Distribution: Xubuntu, Ubuntu, Slackware, Amazon Linux, OpenBSD, LFS (on Sparc_32 and i386)
Posts: 2,684
Blog Entries: 31

Rep: Reputation: 176Reputation: 176
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 06:12 PM.
 
Old 10-14-2021, 06:16 PM   #2
dugan
LQ Guru
 
Registered: Nov 2003
Location: Canada
Distribution: distro hopper
Posts: 11,226

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

Rep: Reputation: 2546Reputation: 2546Reputation: 2546Reputation: 2546Reputation: 2546Reputation: 2546Reputation: 2546Reputation: 2546Reputation: 2546Reputation: 2546Reputation: 2546

What are you trying to do?

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

Rep: Reputation: 470Reputation: 470Reputation: 470Reputation: 470Reputation: 470
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, 02:57 PM   #5
dugan
LQ Guru
 
Registered: Nov 2003
Location: Canada
Distribution: distro hopper
Posts: 11,226

Rep: Reputation: 5320Reputation: 5320Reputation: 5320Reputation: 5320Reputation: 5320Reputation: 5320Reputation: 5320Reputation: 5320Reputation: 5320Reputation: 5320Reputation: 5320
OpenCV has Python bindings.
 
Old 10-16-2021, 01:09 AM   #6
Skaperen
Senior Member
 
Registered: May 2009
Location: center of singularity
Distribution: Xubuntu, Ubuntu, Slackware, Amazon Linux, OpenBSD, LFS (on Sparc_32 and i386)
Posts: 2,684

Original Poster
Blog Entries: 31

Rep: Reputation: 176Reputation: 176
> 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, 01:22 AM   #7
Skaperen
Senior Member
 
Registered: May 2009
Location: center of singularity
Distribution: Xubuntu, Ubuntu, Slackware, Amazon Linux, OpenBSD, LFS (on Sparc_32 and i386)
Posts: 2,684

Original Poster
Blog Entries: 31

Rep: Reputation: 176Reputation: 176
> 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, 02:54 AM   #8
NevemTeve
Senior Member
 
Registered: Oct 2011
Location: Budapest
Distribution: Debian/GNU/Linux, AIX
Posts: 4,864
Blog Entries: 1

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

Rep: Reputation: 2546Reputation: 2546Reputation: 2546Reputation: 2546Reputation: 2546Reputation: 2546Reputation: 2546Reputation: 2546Reputation: 2546Reputation: 2546Reputation: 2546

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, 02:45 PM   #10
Skaperen
Senior Member
 
Registered: May 2009
Location: center of singularity
Distribution: Xubuntu, Ubuntu, Slackware, Amazon Linux, OpenBSD, LFS (on Sparc_32 and i386)
Posts: 2,684

Original Poster
Blog Entries: 31

Rep: Reputation: 176Reputation: 176
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, 04:45 PM   #11
boughtonp
Senior Member
 
Registered: Feb 2007
Location: UK
Distribution: Debian
Posts: 3,601

Rep: Reputation: 2546Reputation: 2546Reputation: 2546Reputation: 2546Reputation: 2546Reputation: 2546Reputation: 2546Reputation: 2546Reputation: 2546Reputation: 2546Reputation: 2546

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, 06:24 PM   #12
EdGr
Member
 
Registered: Dec 2010
Location: California, USA
Distribution: I run my own OS
Posts: 998

Rep: Reputation: 470Reputation: 470Reputation: 470Reputation: 470Reputation: 470
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, 01:46 PM   #13
dugan
LQ Guru
 
Registered: Nov 2003
Location: Canada
Distribution: distro hopper
Posts: 11,226

Rep: Reputation: 5320Reputation: 5320Reputation: 5320Reputation: 5320Reputation: 5320Reputation: 5320Reputation: 5320Reputation: 5320Reputation: 5320Reputation: 5320Reputation: 5320
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, 02:00 PM   #14
John VV
LQ Muse
 
Registered: Aug 2005
Location: A2 area Mi.
Posts: 17,624

Rep: Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651
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:	15
Size:	220.8 KB
ID:	37495  
 
Old 10-18-2021, 07:21 PM   #15
Skaperen
Senior Member
 
Registered: May 2009
Location: center of singularity
Distribution: Xubuntu, Ubuntu, Slackware, Amazon Linux, OpenBSD, LFS (on Sparc_32 and i386)
Posts: 2,684

Original Poster
Blog Entries: 31

Rep: Reputation: 176Reputation: 176
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



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 07:41 PM
Cookies in PHP where resized images generate on the fly each time source is read? ziphem Linux - General 0 02-15-2014 03:44 AM
How to Generate MD5SUMS.sign files while uploading ISO images kushalkoolwal Linux - Security 2 07-06-2008 11:30 AM
C++/SDL: Images moving too slowly. Images loaded once, etc. Why? RHLinuxGUY Programming 2 05-26-2007 05:11 PM
Convert cd images to dvd images rcsuk Debian 2 07-11-2005 10:34 AM

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

All times are GMT -5. The time now is 09:28 PM.

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