File Format – Are not all digital images ultimately only pixel values ​​between 0 – 255?


A bitmap (BMP) is essentially what you describe, an array of numbers that represent pixel colors. For example, something like

1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1

Lossless compression

Now let's define a compression scheme. In our compression scheme, we have an array of number pairs. For example,

3, 1, 1, 0, 7, 1

First, let me point out that this compression scheme represents the same pixels as the first array. The first array has three ones followed by a single 0 and then seven ones. And that's exactly what we represent here. This format is shorter because it represents several pixels with two numbers. The bitmap format must use a number for each pixel.

This is obviously a somewhat simplified view of an image (eg, just a line) and a compression scheme. Hopefully, you can see how a compression scheme changes the format of an image. So a GIF refers to a BMP. GIF uses a compression scheme called Lempel-Ziv-Welch instead of this simplified one.

What we have described here is a lossless compression scheme. One problem with lossless compression schemes is that for some inputs, the encoded form may be longer than the original. For example, to the

1, 0, 1, 0, 1

The coding is

1, 1, 1, 0, 1, 1, 1, 0, 1, 1

Well, that was useless. We have made the input twice as long.

Another lossless compression

Now consider another compression scheme. In this example, we represent the image as superimposed circles. For each circle, we define a center, a radius, and a color.

Our first bitmap would be

5, 5, 1, 3, 0, 0

This is the length of our first compression method.

And our second could be both

2, 2, 1, 2, 1, 0, 2, 0, 1

These are three circles centered in the middle of the element (which is number 2 in the computer count because computers begin to count at 0). A circle has radius 2 and color 1. Then we add a circle with color 0 and radius 1. Finally we have a circle with color 1 and radius 0. In steps this would be

1, 1, 1, 1, 1
1, 0, 0, 0, 1
1, 0, 1, 0, 1


2, 2, 1, 1, 0, 0, 3, 0, 0

This is the same initial circle, but it is covered by two dot circles. In steps it would be

1, 1, 1, 1, 1
1, 0, 1, 1, 1
1, 0, 1, 0, 1

These are both one shorter than the first coded version, but still longer than the original.

You may be wondering why I speak of circles rather than realms. The main reason is that circles are closer to the actual two-dimensional images.

Lossy compression

We also have the concept of lossy compression. These lossless compression schemes can be converted back to the original bitmap array. Loss compression schemes may not be reversible.

Consider a lossy version of our circles method. In this example we use a simple rule. We will not save circles with a radius of less than 1. So in our last two encodings we would have instead

2, 2, 1, 2, 1, 0


2, 2, 1

which are converted back to pixel

1, 0, 0, 0, 1


1, 1, 1, 1, 1

The first version is only one element longer than the original. The second version is shorter. Both are valid, so the algorithm can develop both and choose the shorter one.

We describe images with more restrictive rules than lower quality.

This representation of images as superimposed collections of circular shapes is similar to the operation of the Joint Photographic Experts Group or JPEG format. Its shapes are ellipses rather than circles, but the idea is similar. Instead of our simple method, the discrete cosine transform is used to encode images.

Unlike GIF, JPEG is another way to render the image. GIF is still pixels. They are only stored in other ways. JPEG is forms. To display a JPEG, we convert the shapes to pixels because the screens work that way. Theoretically, we could develop a screen that does not work that way. Instead of pixels, shapes could be created that better match the JPEG format. Of course, this screen can not display bitmaps. To display a BMP or GIF we would need to convert to JPEG.

If you're converting a standard GIF, such as For example, if you convert 300×300 pixels into a JPEG and rotate the quality down, you should see the basic shapes you are using. Many JPEGs avoid these artifacts by starting with a much higher resolution image.

JPEGs scale well because they are shapes rather than pixels. So, if you start with an 8000×8000 image, convert it to JPEG and view it as a 300×300 image, most of the lost details would have been lost anyway. If you converted the 8000×8000 bitmap first to a 300×300 bitmap and then to JPEG, the results are often of lower quality.


We talked about still pictures. The Moving Picture Experts Group or MPEG format uses the same compression type as JPEG, but uses something else as well. While a simple method of creating videos is to send a sequence of still images, MPEG actually sends an image, followed by a series of images listing changes, and ends with a final image. Since most pictures are similar to the previous picture, the list of changes is often smaller than a second picture.

The sequence is usually not that long, say five frames. But it helps to make the stream smaller than it would otherwise.


I ignored a lot. My pictures have only two colors (1 bit), not the 256 of an 8-bit picture and certainly not the 4 294 967 296 of a 32-bit picture. For 8-bit images, keep in mind that you can often select different palettes for the image. Therefore, two 8-bit bitmaps with the same sequence can display images that look different (same shape but different colors).

My pictures are single rows, not two-dimensional. Most images store a specific line size, which makes the arrays two-dimensional.

I did not try to represent the actual encodings at all. They are much more complex than the simple ones I used. I did this because I wanted to describe the encodings in this post. I'm not convinced that I could explain Lempel-Ziv much less than the more complex Lempel-Ziv-Welch refinement in a single answer. And I do not understand Fourier transformations well enough to explain them in detail.

This is a much simplified version of the actual image processing. However, I think that it is easier for didactic reasons to understand the more complex reality, without ignoring the essential points.

The clock can not be changed to 24-hour format in Ubuntu Gnome

I read the three solutions for changing the time display to 12-hour format in Ubuntu and set my time in the GUI to 24 hours using gnome-tweak. I've been able to change my time and date format, but I can not set it to 24-hour clock: the "AM" will still be displayed. That's despite

  1. "Time format" is set to "24-hours" in the GUI,

  2. Enter command gsettings set org.gnome.desktop.interface clock-format '24h'

  3. and put within to> gnome> desktop> interface> clock-format inside dconf-editorand change the format to & # 39; 24h & # 39;

How can I retrieve the 24-hour format? Is there a different attitude that could contradict these three methods?

Blog Comments – Author Name and Format -. :: GSA SEO & Marketing Forum ::.

I wonder if I create custom blog comments. Is it possible to add line breaks to comments?

And secondly, is there any way to refer to the first or last name of the author? EG% first name% or so?

It would be great to do both for blog comments.

Here is a sample comment we could make if they were enabled / possible:

Conditional Formatting – Sheets: Format if the value is duplicate and the corresponding cell of all other duplicates is empty

I have a list of customers who contacted us. We have to return to them. I would like to format if: 1. You appear twice in the list and 2. We did not come back to her on any of her appearances in the list.

For example, if A5 is duplicated in A478, the leaves should check cell B478 and format A5 if B478 is a bank.

Thanks a lot!

dslr – Why has not anyone made a CMOS sensor for digital cameras in 645 or 6×6 format?

I understand that the price of silicon does not always scale linearly with its size / number of components, but I'm really curious why we have not yet seen digital camera sensors in true medium format sizes. It appears that even the high-end camera manufacturers are exceeding a current sensor size limit because the camera with the largest sensor size I can find is the Phase One IQ4, a $ 50,000 camera, that has a sensor size just under 645 film size.

I think the bigger the sensor, the better the picture quality, and so there is a market for professional photographers who want to stand out from the competition. One might therefore assume that there is a market incentive to produce sensors that match some of the larger film sizes.

Above all, are economies of scale that only make the production of certain sizes of sensors, which are currently not produced in series, expensive? Do factories need updating to facilitate the production of these larger sensors? Or are there existing limitations in existing manufacturing techniques that prevent companies from producing an arbitrarily large CMOS sensor?

Database – Convert a timestamp to a date format in Drupal 8 custom module

I have created a custom module and printed this result in .csv

Ea Iustum Jus,Fifa,example@asdf.wer,1573924224,

How do I convert this timestamp to a date format?
I have tried 2 options in mymodulecontroller.php:

1.$select->addField('c','created',"DATE_FORMAT(FROM_UNIXTIME(created), '%d.%m.%Y %H:%i'");
Second$select->addField('c', 'created', date('m-d-Y',$select));

this is what mymodulecontroller.php looks like

addField('c', 'created');
namespace DrupalmymodulelistController;
use DrupalCoreControllerControllerBase;
use DrupalCoreDatabaseDatabase;
use SymfonyComponentHttpFoundationResponse;
* Controller for mymodule List Report in .CSV
class DownloadCSVController extends ControllerBase {
* Gets all mymodules List for all nodes.
* @return array
protected function load() {
$select = Database::getConnection()->select('mymodulelist', 'r');
// Join the users table, so we can get the entry creator's username.
$select->join('users_field_data', 'u', 'r.uid = u.uid');
// Join the node table, so we can get the event's name.
$select->join('node_field_data', 'n', 'r.nid = n.nid');
// Select these specific fields for the output.
$select->join('mymodulelist', 'r', 'r.mail = r.mail');
// Select these specific fields for the output.
$select->join('mymodulelist', 'c', 'r.created = c.created');
// Select these specific fields for the output.
$select->addField('n', 'title');
$select->addField('u', 'name', 'username');
$select->addField('r', 'mail');
// how to create a date format from unix timestamp to d-m-Y for the field created ??
$select->addField('c', 'created');
// I tried this 2 options
// 1. $select->addField('c', 'created',"DATE_FORMAT(FROM_UNIXTIME(created), '%d.%m.%Y %H:%i'");
// 2. $select->addField('c', 'created', date('m-d-Y',$select));
$entries = $select->execute()->fetchAll(PDO::FETCH_ASSOC);
return $entries;