Python Forum
Byte string catenation inefficient in 3.7?
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Byte string catenation inefficient in 3.7?
#9
(Aug-16-2019, 01:38 PM)ThomasL Wrote: Do you know Numpy?
An images can be represented as an array of values.
I actually don´t understand why you are building a bmp with strings / bytes / bytestrings or what so ever.

There are lots of tutorials around this matter http://scipy-lectures.org/advanced/image_processing/

Ok Ive taken a quick look at numpy.
1. Am I correct that numpy itself does not contain output function?
2. One strategy could be to build the pixel grid as an numpy 2-D array (indexing, no catenations) then ravel it and convert to byte string for the same file.write() as presently. Not clear to me if that would be trivial out of the box code or very fiddly?
3. It looks like scipy has some output functions (imsave) but does it handle all the headers properly?
(Just looking for a roadmap so I dont go down too many dark alleys!)
Reply


Messages In This Thread
RE: Byte string catenation inefficient in 3.7? - by RMJFlack - Aug-16-2019, 04:14 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  pyreadstat write_sav inefficient mikisDeWitte 2 2,762 Jun-21-2021, 09:49 AM
Last Post: mikisDeWitte
  'utf-8' codec can't decode byte 0xe2 in position 122031: invalid continuation byte tienttt 12 11,591 Sep-18-2020, 10:10 PM
Last Post: tienttt
  'utf-8' codec can't decode byte 0xda in position 184: invalid continuation byte karkas 8 31,719 Feb-08-2020, 06:58 PM
Last Post: karkas
  First Byte of a string is missing while receiving data over TCP Socket shahrukh1987 3 4,260 Nov-20-2019, 10:34 AM
Last Post: shahrukh1987
  HELP: String of Zero's and One's to binary byte schwasskin 1 3,878 May-19-2019, 07:31 AM
Last Post: heiner55
  4 byte hex byte swap from binary file medievil 7 22,124 May-08-2018, 08:16 AM
Last Post: killerrex
  get the content of the byte as string ricardons 5 3,697 Mar-02-2018, 02:41 PM
Last Post: ricardons
  byte string Skaperen 5 3,879 Feb-04-2018, 08:58 AM
Last Post: Gribouillis
  byte string in python2 Skaperen 4 4,353 Nov-23-2017, 03:13 AM
Last Post: Skaperen
  Does Python 3.x have a built-in byte string compare function? Raptor88 2 16,425 Feb-18-2017, 10:44 AM
Last Post: Raptor88

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020