Thursday, August 31, 2023

Automated abstract art

 kw: experiments, simulated intelligence, art, generated art, images, prompts, abstract paintings

I wanted more pieces of generated art to use for Zoom backgrounds. I happened to see an abstract mural at a restaurant so I took a picture and looked it up. The artist was Lyubov Popova (1889-1924). I downloaded a couple of Popova's pictures and one by Zaza Tuschmalischvili (b. 1960), cropped portions of them, and in three sessions, uploaded each portion to Dall-E2 as a "seed" for some outpainting. The prompt for each session was the same with the exception of the artist's name:

Angular abstract painting in the style of [artist]

Here are the three results.


With the third one, by a living artist, I worked back and forth, eventually erasing nearly all the original seed, so it became more of an inspiration than an integral part. I like all three, though they are rather garish for use as backgrounds. For that purpose I lightened them by adding about 50% brightness to each, with this result:


Depending on the audience, one of these could be an appropriate background. I tried to create abstract paintings without specifying style; here is one of the results, based on the prompt

Abstract painting with vertical grain, melancholy color scheme, low key


The location of the color bar shows that I painted this in vertical orientation, then turned it sideways. Even lightened up, it seems inferior to the ones above, as a background at least.

For the sake of academic meetings or among those who love libraries, I also ran the prompt

A wall of bookshelves filled with books of all colors and many sizes

I outpainted it to two sizes. The smaller one, which is close to HD, I also lightened for use as a background. The larger one (with more shelves) is nearly 4K.


On an HD monitor these all fill the screen. On a larger one, the images with fewer pixels may not do so. This image competes in my affections with the "Big Library" image, shown in this post.

Wednesday, August 30, 2023

Automated art, illustrating Outpainting with DALL-E2

 kw: experiments, simulated intelligence, art, generated art, images, prompts, photo essays

A charity, prospecting for contributions, included some Christmas cards with their appeal. This one really appealed to me. I decided to scan it and upload it to Dall-E2 so I could extend it by Outpainting. In earlier posts on automated art I wrote of Expanding, but Outpainting is the main term used by OpenAI. The original painting is "Holiday Social", copyright Geno Peoples 2017. The artist's website shows this and many other paintings in this "luminous cottage" style and other similar styles (note that the website is not secure).

I tried scanning at various resolutions with descreening, both automated and manual. What worked best was a cell phone photo, manually descreened and reduced in pixel resolution. I suppose I could have downloaded it from the website, where an image 1100x717 is available. If you want one of his paintings big enough to print on canvas you can buy it there. The image above is 1024x763, and is a bit narrower than the original.

When you log into Dall-E2, you can either start with a prompt to generate an image or upload something you want to edit. I prepared this image, and a slightly larger rendition (1450x1080), to experiment with uploading and outpainting. Eventually I ran three outpainting sessions. Grammatical note: In a lengthy discussion like this, I tire of circuitous locutions using the pronoun "one", so I will instead use "you" language.

When you open a Dall-E2 session and upload an image, you have the option to crop it to a square or leave it uncropped. In all cases I skipped cropping. If you crop the image, it is squared up to a size of 1024x1024 pixels or smaller. Every Generate action is done within a Generation Frame of size 1024x1024.

First Session 

I first used the 1450x1080 version, which was loaded at full size when I clicked "Skip cropping". It is necessary to add a prompt before you can click Generate. I began by adding material at all four corners. The image below shows the Edit screen after the first two additions. The buttons at the bottom are, from left to right, Select (for moving the Generation Frame), Scroll (for moving the entire image, Frame and all), Erase, Add Frame (for initiating a Generation Frame), and Upload (which I haven't used. I suspect it lets you add an object to the image but I don't know). The Generate button is above this part of the screen, on the right side. There is a download button next to it, and I use it frequently, keeping in mind the admonition in the gray box at lower left (you may need to click on the image to see it large enough to read that text). Downloaded images are PNG files, about 3-4 times the size of JPG files, but with no compression losses. 

The prompt at this point reads "A holiday visit on a snowy day at sunset in the style of Geno Peoples"; I changed it later.

When you click Generate at any point, you have four choices to choose among. If none is acceptable, you can click Cancel and Generate again (consuming a credit...sigh). After outpainting in all four directions I had this result:

The two extensions in the sky added versions of the sun near sunset, which I didn't like. I combined more outpainting with editing. The next image shows the upper right corner during this process.




The white circle at center right is the eraser. I got rid of the bright bit of sky and an unusual looking window in the tall building. I also removed the sun image at left (not shown in this crop) during the following Generate event.

After getting the sky to my liking, I added material below the two extensions I had made, which yielded the image below, which is now 2560x1728 (the image here is smaller). I can crop a 16:9 portion for my wallpaper folder, any size from 1920x1080 to 2560x1440.



It's notable that the extension of the village to the right in particular adds buildings that are not quite the same style as the original ones. Producing this image consumed 8 credits.

Second Session


I started a new session, uploaded the 1024x763 version and skipped cropping. Here I am about to add material at upper right. You can see that the uploaded image is smaller than a Generation Frame. I was hoping to produce a larger village, relative to the initial painting.

I wonder if I should have outpainted in smaller increments, such as having the Frame begin at the base of the large house. I did some Cancels this time. Buildings being added were often in a clashing style. Midway through the process I appended the words "finely detailed" to the prompt. It made little difference. Here we see the result after four corners were extended:


This image needs some work. As the next image shows, I did a lot of erasing while further extending. I ignored the added Moon; I plan to crop it out of a 16:9 image later.


Erasing while outpainting produced an image I like a bit better, shown next, but I like it less than the final image from the first session. 


This image (here it is reduced) is 2304 x 1792. I can crop out anything from 1920x1080 to 2304x1296 if I decide to use it as wallpaper. Producing it consumed 10 credits. Not as much bang for the buck as usual.

Third Session

I decided to try again with the 1024x763 version. Before outpainting I entered a different prompt: An old-time village in winter just after sunset with meltwater on snowy roads, in luminous cottage style

This time I extended downward first, to fill a 1024x1024 square, then I extended to the right and the left, with one Cancel, to get this:


This is 2240x1024. The added material is a bit cruder than the original painting, so I won't outpaint further. Rather, to produce a wallpaper image I'll increase the resolution (I use IrfanView, but Photoshop and Gimp are also good) to 2362x1080. I may use Unsharp Masking to boost the apparent sharpness a little. Then I can crop out a 1920x1080 piece, probably more to the left to include less of the reddish buildings. In the prompt I didn't refer to Geno Peoples, but used a more generic style note. I am not sure to what extent it helped. This image consumed 4 credits. I like it better than the one from Session 2.

Dall-E2 is an enjoyable collaborator, very useful but sometimes recalcitrant. It keeps things interesting.

Tuesday, August 29, 2023

Some spiders go domestic

 kw: blogs, blogging, spider scanning

I just had a look at the stats for this blog. It seems there has been a week of heavy activity, culminating in close to 14,000 views just today. Here's the hourly breakdown:


The country breakdown has changed from the recent past:


Ignoring the crumbs from Germany on down, the big hitters are the US and Singapore, in a 3:1 ratio. Ini the past month we see this:


Before today Singapore predominated. The current rush began six days ago. The numbers from UK onward are more typical; 1-2 per day per country, or less.





Automated art, landscapes and beaches

 kw: experiments, artificial intelligence, simulated intelligence, art, generated art, images, prompts

I tried a few prompts to produce landscape paintings, even though both photos and scanned artwork, in large (HD and 4K sizes), abound in Google Images and Yahoo Images. I have downloaded many such images into folders that are used by a "screen saver" slideshow program when my computer is idle. Anyway, I thought it worth trying. I first tried Asian art, then more "ordinary" forest scenes, using the following prompts:

  1. A woodcut of a pagoda near a lake in mountainous country colored with pastels
  2. Ink and watercolor, highly detailed, Chinese scroll landscape with pine woods, steep hills, and a river
  3. a calming forest scene with wildflowers in a meadow, a stream, and a small pond, landscape painting
  4. A painting of a meadow in a hardwood forest with a stream and scattered wildflowers, mountains in the distant background


The prompts are clockwise from top left. The pagoda image is rather clumsy. There are two ways that block prints IRL are colorized. Some are printed from a single block with shading and then hand-colored later, and others are printed from multiple blocks with colored inks. This image looks like the latter case. That is to say, multi-block prints were used by Dall-E2 as the "universe" of images to respond to my prompt.

The scroll painting has interesting frame shifts in three places. Near center, what appears as a small waterfall at the base of a dark cliff morphs into a root wrapped on a broken-off tree trunk with growth on its top. At lower right, the scale seems to change, with tiny trees appearing to be far away when viewed in isolation. At upper left, a bit of detached landscape floats in the air. Dall-E2 does such "hallucinations" at times.

The two forested landscapes are both pleasing to me, and I often use one or the other as a background with using Zoom with a green screen. I've found that Dall-E2 "assumes" conifers are meant when "forest" is prompted, unless one specifies "hardwood", or perhaps "deciduous". These hardwoods appear to be birches. If I wanted oaks and maples I'd have had to say so.

I also like beaches, so I tried a couple, with these prompts:

  1. A sandy beach next to a rocky beach below cliffs, digital art
  2. A long stretch of sandy beach backed by sea cliffs, winding towards a distant horizon, digital art


The upper image reminds me of a portion of Pismo Beach, a place I stayed a couple of times several decades ago. The lower one came out like an aerial photo or drone shot. The shape of the bluffs is reminiscent more of a semi-tropical area such as New Zealand (sadly, known to me only through photos). I could have erased the sand bars at lower right and had Dall-E2 put in more water, but they do add a little interest. My favorite body-surfing beaches, near Huntington Beach south of Los Angeles and Sunset Beach to the north, have sand bars at low tide, which at high tide generate large, fast breakers that are a thrill to ride, but not popular with surfboarders.

Monday, August 28, 2023

Another science book ruined by politics

 kw: book reviews, nonfiction, science, biology, sociology, deception

The first three verses of 1 Samuel 16, in the NIV, read thus:

The Lord said to Samuel, “How long will you mourn for Saul, since I have rejected him as king over Israel? Fill your horn with oil and be on your way; I am sending you to Jesse of Bethlehem. I have chosen one of his sons to be king.” But Samuel said, “How can I go? If Saul hears about it, he will kill me.” The Lord said, “Take a heifer with you and say, ‘I have come to sacrifice to the Lord.’ Invite Jesse to the sacrifice, and I will show you what to do. You are to anoint for me the one I indicate.”

The prophet Samuel had anointed Saul to be king a few decades earlier (1 Samuel 10:1). It soon becomes evident that king Saul is impatient, hasty, and disbelieving. God is ready to replace him with a king "after God's own heart", which is to be David. To avoid stirring up Saul's jealousy, God instructs Samuel to travel in a deceptive way. Some say that God instructed Samuel to lie. It does seem so.

Does this violate the Ninth Commandment? In the NIV translation we find, “You shall not give false testimony against your neighbor.” Bible translations are about evenly divided between "false testimony" and "false witness". This refers to giving testimony in a court proceeding. It seems God has less interest in "everyday lying", particularly when it could save your life.

This chimpanzee is hiding his face while eating, furtively, hoping a higher-ranking chimp won't come along and take the food away. Chimps also hide food, and more particularly, a courting couple hides from others to consummate their union, even though the highest-ranking chimps mate publicly.

Are these things lying? They are done intentionally, so most certainly, yes. And they are done at a higher level than the way most husbands would answer, "Does this skirt make me look fat?" (The one question we can be sure even George Washington may have answered with a white lie)

Let's consider a different animal, a leaf-mimic katydid. This is a species similar to the one pictured on the cover of The Liars of Nature and the Nature of Liars: Cheating and Deception in the Living World by Lixing Sun.

The evolution of such detailed leaf-mimicking appearance, in numerous species of katydid and other insects, required tens to hundreds of thousands of years of refinement. Can this insect's appearance be called a lie? There is no intention involved, so even though the appearance is deceiving, the deception is a natural characteristic of the animal, honed by thousands of generations of evolution. It is unlikely that the katydid even knows it looks like a leaf.

Dr. Sun discusses the three words "cheating", "lying", and "deceiving", and places the second and third under the first, as categories of cheating. I suppose that's a useful philology. It still doesn't answer the question, "Is a naturally deceptive characteristic a kind of cheating?" I would say that perhaps we need some new words, and that genuine "cheating" of any kind requires understanding on the part of the "cheater". Thus, my understanding of these words differs from his.

The first 60% of the book, by page count, deals with deception of many kinds in nonhuman animals, bringing out the author's two Laws of Cheating: (1) Transmission of false information (lying) and (2) Confounding the defenses of the receiver (deception). An example of the first "law" is the firefly that flashes the same as the female of a different species; when the male approaches it finds itself to be lunch rather than mated. An example of the second "law" is the leaf-mimicry of the katydid above, and similarly the color mimicry among many species of butterfly, such as the Viceroy mimicking the Monarch. It takes advantage of the warning colors of the Monarch, advertising its noxiousness (gained when its caterpillar ate the very bitter milkweed leaves). The Viceroy doesn't taste bad, but a potential attacking bird shies away anyway.

In nature, many cheats have the purpose of foiling predators. Many others are for enhancing mating opportunities, including the sexual displays of birds and the "dances" of many species including some spiders and most vertebrates. Sexual displays in particular are intended to be "honest" signals of good fitness. Usually they are, but in the book we read of several ways that less-fit individuals procure chances to mate, by one deception or another.

As the book turned to human cheating in Chapter 6, it became apparent that, sadly, the author had an axe to grind, namely, the incident on January 6, 2021, falsely called an "insurrection". Let's get a few facts straight about that:

  • Early on it was called an "armed insurrection". When it became apparent that the only arms present were on the persons of the Capitol Police, this term vanished from the news.
  • A total of five people died. None of them was a Democrat. None of them was a member of Congress or a staffer. One of the five actually died days later of a stroke, and it is not clear whether the stress of the event prompted it. In a genuine insurrection, the early result is a few hundred to a few thousand deaths. This wasn't even a decent riot.
  • The first people to enter the Capitol building were ushered in as sightseers by Capitol Police. They were not part of the crowd that was still listening to President Trump finish speaking.
  • About the same time, videos that are now hard to find show a busload of black-clad people, either members of Antifa or people dressed as Antifa, who changed into less conspicuous clothing and mixed with the crowd. They were agents provocateur.
  • The provocateurs performed the first acts of violence and incited others.
  • The entire incident was over before the bulk of the crowd that had been with Trump came into the vicinity of the Capitol building.

Democracy was never in danger, contrary to what Dr. Sun states in his Acknowledgements as the motive for writing the book. He is himself a purveyor of deception, although I will allow that he is repeating the deception fostered by others; he is not the source. He just listens to the wrong news programs. As to the statements by him and many others, that claims the November 2020 election was fraudulent are "false", I have a story to tell.

On Election Day my wife and I both voted for Donald Trump. The machines in use in our polling place have a big touch screen with buttons next to names. One pushes a button, which lights up. After one is done pushing buttons, the ballot is printed by pressing a big green button. Then the ballot containing the names of those voted for slides into a window for review; push the green button again and it is zipped into the ballot box; push a big red button instead, and the process aborts, and then the poll workers are supposed to extract and destroy the ballot for a re-try. In my case, all went as usual. Not so for my wife. She pressed buttons for Donald Trump and for other names and initiatives, and pressed the green button. When her ballot slid into the viewing window, it said "Joseph R. Biden". She was too shocked to move. After no more than five seconds, without any action on her part, it zipped into the ballot box. She came out and told me about it, but it was too late to do anything. Her "vote" had been placed...and stolen.

In all the swing states, a similar incident only needed to occur about 1% of the time, to sway the vote to the "wrong" Electors.

A further bit of evidence is this: Millions of ballots contained a vote for Joe Biden but had no other votes on them, not for any Senator nor Congressperson nor ballot initiative. In a typical election, such "one name" ballots are extremely rare. To me this is further evidence of vote tampering.

Nonetheless, once Mr. Pence had certified the election, Joe Biden became the President. That's how the rules work. Four years earlier millions of disenchanted leftists (who happened to be members of the Democrat party) shouted, "Not my President!" about Mr. Trump. In 2020, I don't know of any Republicans who did so. We play by the rules. But the rules seem to be changing.

So let's look at lying in modern America. In the 1990s this saying became current: "How do you know Bubba (Bill Clinton) is lying? His lips are moving." A little later, this one appeared: "Sometimes a Republican politician will lie. Bubba lies constantly just to keep in practice." Then, in 2015 when Bubba's wife Hillary was campaigning, a follow-on proverb stated: "Guess who taught Bubba how?"

And for those who claim it is a "crime" for Mr. Trump to complain that the election was rigged, Mrs. Clinton has been claiming that the 2016 election was rigged in nearly every speech she has delivered in all of the seven years since! Why not put her in jail? Where is her mug shot?

Let's dig out another error in the book. On page 157 it is stated that today the Federal government employs less than 2% of the American workforce. The actual number is 2.8 million, which is the "cap". By law, the government cannot employ more than this. The paragraph ignores the 12-13 million contract workers who are also effectively on the Federal payroll, while under the aegis of their contracting companies. This is how the government gets around the cap. The actual size of the Federal government workforce is 9.3%. Thus, a statement that "the Chinese population is three times larger than the population of the US, [while] its government is 13 times larger" is grossly misleading. 13 x 2% ÷ 9.3% = 2.8. Thus in proportion to population, the US government workforce is larger than that of China.

It is said, "A lie can circle the Earth three times while truth is tying its shoes." We are prone to pay more attention to lies, precisely because so many lies are designed to attract attention. Misdirection, for example, refocuses attention on some "bright shiny" thing to draw our attention away from the truth that is quietly sitting by.

Coping with the numerous errors that erupted once the author turned from science to politics, I don't have the heart to review this book further. I recommend that the reading public wait for someone more worthy of our trust to write on the subject.

Friday, August 25, 2023

Automated whimsy and scenery

 kw: experiments, artificial intelligence, simulated intelligence, art, generated art, images, prompts

The set of prompts I used for the next montage leans toward the whimsical. These took a bit of extra negotiation to achieve the looks I liked. In clockwise order from top left:

  1. Many minions merrily marching through a forest meadow
  2. a very hilly landscape with many antique clocks, digital art
  3. a very hilly landscape with many antique clocks, digital art [2nd Generate]
  4. a fantastic library with thousands of books and many patrons


Since the screening of Despicable Me the word "minion" has never been the same. The two "clocky landscapes" arose from a family hobby of collecting antique clocks. I keep only two old clocks running. When I was in high school, my father had 25 mantle clocks running in nooks that held my mother's collection of paperback books, plus a cuckoo clock on the wall. All chimed. Noon and Midnight were noisy! I feel a certain affinity with Jorge Luis Borges, who said, "I have always imagined that Paradise will be a kind of library." Although I asked for "many patrons" I see no more than ten, and many of those are sketches that look more like odd piles of books than people.

I also got to wondering how the "city of God" as described in The Revelation, the New Jerusalem, might look if it were a real city (the apostle John called it a Sign). It is described as foursquare, and as high as it is wide, a kind of golden mountain. DALL-E came up with all kinds of peculiar things, so I asked for "Mont St Michel by morning light". The two top images of the next montage are from outpainting the result, which is close to, but not exactly, like certain photos of the city. The first is as "we" produced it, and the 2nd is adjusted to look more golden. The lower two images began with the prompts,

A painting of a wide landscape with mountains around the edge and a domed city
A small town in a wide valley with snowy mountains in the background, realistic painting

My wife collaborated in the choices to produce the last one (lower right). We liked it well enough to have it printed in a size that fits a frame I had handy, and it hangs near oil paintings by my father; it is similar to his style.


Producing each of these took between six and ten credits, and time from a half hour to an hour. Considering how long it used to take my father to paint a landscape, I have the satisfaction of producing an image rather quickly, to gain more time to think over what I might do next.


Wednesday, August 23, 2023

Wise, maybe; skilled, definitely!

kw: book reviews, nonfiction, science, natural history, memoirs, owls

The collective term for owls is usually "parliament", at least in Europe. On this side of the pond, "congress" is equally common. This is because owls are considered wise, at least in folklore, because of their face and demeanor, and parliaments and congresses are expected to consist of wise persons. These days, that's questionable!

These are most likely Tawny Owls (Strix aluco), the subject of the second chapter in The Wise Hours: A Journey into the Wild and Secret World of Owls by Miriam Darlington.

Ms Darlington traveled around the British Isles, including Iona, to observe the five species of owl to be found there: Barn Owl, Tawny Owl, Little Owl, Long-Eared Owl, and Short-Eared Owl (the scientific names are explained in the chapters). The Eagle Owl native to Eurasia is sometimes seen in England, but she traveled to Finland to see them, and even to handle some chicks being censused (an Eagle Owl chick needs very careful handling; they can credibly claw your arm off). She also encountered owls in Croatia and France.

For those whose main memory of owls is of the letter-carriers in the first Harry Potter film, these are not subdued, passive birds. Owls tend to live on the edge of existence, with seldom a trace of body fat. A bird that looks the size of an 8 pound housecat may weigh only a pound under all those fathers. A male Pygmy Owl weighs just over 2 ounces, the female about 2.5 ounces. They have the attitude of conquering giants. The author often remarks upon their outraged look upon capture. An owl's hooked beak is eminently suited to decapitating its prey, the mouse, vole, rat, lemming, songbird or even smaller owl once it takes it. The details of owl feathers ensure silent flight; if you get too close to a nest and cannot be lured off, the parent bird might attack from above and behind, and you'll never hear it coming. 

If we weren't so culturally bound up in "wise old owl" folklore, we'd call them silent assassins. Their habits are as varied as their habitats, but the silent attack from above is pretty universal. Even those owls that wait in ambush rely on silence and stealth to approach their prey.

Sadly, in many areas owls are under siege because they are misunderstood to prey on pets or farm fowl. They are usually much more interested in rodents and, for smaller owls, crickets and locusts and other pests. A pair of barn owls, for example, need a daily mouse apiece, and when they have growing chicks, each chick must be fed two or three mice daily. That adds up to around a thousand mice yearly per pair. The only folks who have a credible complaint against owls as predators are those who want the mice left for game animals such as foxes (this more in England than America; we Yanks don't understand fox hunting). The author, along with owl aficionados, crusades for owl preservation. It costs much less to install nest boxes to attract resident owls, than to put out rodent poison. Farmers who "employ" owls for rodent control come to have great affection for their airborne assassin squads.

In North America, we may seldom see an owl, but in forested areas we hear them. The common "owl call", "Hooo-hoo-hoo-hooooh" is the Great Horned Owl. Other sounds are made by the various screech owls, which are well named, while a Barn Owl makes a scream or shriek more like a large hawk, but lasting about two seconds. If you get to know the calls of the local owls, take comfort that "someone" is out there doing their best to make a dent in the rodent population.

Ms Darlington carried out her studies of owls while caring for her son Benjy, who as a teen became afflicted with a seizure disorder similar to epilepsy. The extra stress provided the "lemons" for her to "make lemonade" by including her daughter and son in some of her escapades, at least among local and regional owls. She writes with lyrical abandon. Reading the book fills one's heart.

Friday, August 18, 2023

Learning Automated Art

 kw: experiments, artificial intelligence, simulated intelligence, art, generated art, images, prompts

Much of my early exploration of DALL-E2 was learning to use prompts. Longer, more descriptive prompts are usually considered better. An early experiment with single-word prompts (some real words and some nonsense words) can be seen here.

The third image I considered worth extending (DALL-E2 also calls it Outpainting) is a city on an alien planet with a purple sky. Over time I did three more on the Alien Planet. The four prompts refer to the images from top left in clockwise order:

  1. Futuristic city on hilly alien planet with violet sky and two moons
  2. an alien forest with orange trees, blue and yellow flowers, a placid stream and a small moon in the bluish-white sky in the style of chesley bonestell
  3. A futuristic city on a wide plain surrounded by mountains on an alien planet with a greenish-blue sky and two small moons
  4. A city of spindly buildings on a low gravity planet with a deep blue sky having thin, scattered high clouds, and very high mountains in the distance


The first is cropped from a longer, panoramic image. In the second, although I specified orange trees, I got orange dirt also. This one was intended as a landscape rather than a city. Although the first and third prompts are very similar, one can see how differently DALL-E2 can interpret a prompt, and how I may choose something quite diverse from the earlier look. Even where I didn't ask for a moon, DALL-E2 supplied one. I guess that's part of what makes a scene look "alien" in the training set. I can't say I prefer any of these images more than the other; I like each differently.

In my formative years I usually had access to desert landscapes, and I like the desert. I produced two desert scenes so far, and I may yet do more of them. The prompts, followed by the montage:

  1. Desert landscape with mesas and saguaro cactus
  2. A desert scene with exaggerated mesas and steep mountains around an alluvial valley, digital art


The first was intended to evoke Arizona; the second was to be more fanciful. Of course, one can produce vertically exaggerated landscapes by stretching the image later, but asking for it at the outset produced a landscape I find very pleasing.

As another example of post-processing, I tried inverting the colors of the blue-orange alien planet scene:

Comparing this with the one above, I see that DALL-E2 chose totally complementary hues to base its blue and orange palettes upon. Neither this nor the original is much like what I was originally looking for, but I find them both interesting.

I used IrfanView to invert the colors. It can also do color channel swapping. There are five possible transforms; some are 1-2→2-1 reversible, and the others rotate 1→2→3→1. For this variation I used a rotation: RGB→BRG:

That's starting to look really alien!

Later I'll also explore making composite images.



Wednesday, August 16, 2023

Adventures with automated art

 kw: experiments, artificial intelligence, simulated intelligence, art, generated art, images

Do you desire to make art, but can't draw? I'm like that. My father painted as a hobby for much of his life, and my house and my brothers' houses contain numbers of his paintings; he also sold a few and gave away even more. One of my brothers got all the art talent, and I got very little. I learned of prompted art generation almost a year ago, and last November I decided to give it a try.

I tried out all three major art-generation sites, DALL-E2, MidJourney, and Stable Diffusion. My early take on these is posted here. Since that time I've used DALL-E2. A quick intro:

  • When you start you get 50 free credits. Another 15 free credits arrive each month thereafter.
  • Added credits can be purchased at the rate of 115 for $15. I find that I buy more credits about every second or third month.
  • To start, after setting up an account and logging in, there is a space to enter a prompt. You'll use many of your first 50 credits getting used to writing prompts. There are tons of YouTube videos where you can get creative and useful ideas.
  • You can also upload an image you want to edit. I won't get into that.
  • When you click Generate, you get a panel of four square images. Their size is 1024x1024 (in the earlier version of DALL-E they were 512x512).
  • You can click on one of the four squares to see it larger, and download it as a PNG file; its size will be 1.5-2 Mbytes.
  • When looking at one of the squares you can click Edit. The two main options here are Erase and Extend (called Add a Generation Frame). You can also upload an image at this point, but I am not sure what happens; I haven't tried it.
    • Use Erase to remove a part of the image you'd like re-rendered differently. Then click Generate and you get 4 versions to look among (a 4-dot clicker to select). You can Accept one of them or Reject and try again.
    • Use Extend to activate a 1024x1024 marquee that you can move around to an overlapping area. Be sure there is some overlap, or you'll get a discordant appendix. Here again you have four versions to select among, to either Reject or to Accept the one you like best.
  • I do tons of Extending, to turn 1024x1024 images into 1920x1080 or larger. I haven't tried going all the way to 4k (3840x2160); that would take at least a dozen Extend tries.
  • Note that each time you click Generate it uses one credit, whether you Accept or Reject the result.

The two images below are the beginnings of a Mountains theme. The prompts that generated the starting squares were

  1. Mountainous Landscape in the style of the Hudson School
  2. A mountain cabin in the style of Thomas Kinkade


These are the first and fifth "paintings" I generated. (You can click on any image for a larger version; this image is a 2-pic pasteup). Each took six or seven Generation events, so each cost less than $1. For the second image I found I had to edit the prompt after a couple of steps, or DALL-E2 would insert more cabins and even whole floating mountains. Prompt editing is a skill in itself. It is part of the "negotiating" one does with DALL-E2 to get the results you want. So is Erasing sections, small or large, and using up more Generate credits.

For my second painting I did a Still Life in the style of Paul Cezanne. Later I did three others. All are shown here, and their prompts, clockwise from top left, were

  1. Still Life with apples, pomegranates, and bananas in the style of Paul Cezanne
  2. A still life painting with cheeses and fruits and a vase in the style of Clara Peeters
  3. A still life painting with peaches, grapes and a vase of flowers, in the style of Raphaelle Peale
  4. A still life painting with a cornish hen, grapes, and leafy greens in the style of Pieter Claesz


For a sense of the scale of extending these images, here is the initial panel from the Paul Cezanne prompt:


This is shown at a roughly similar scale. You can see that I Extended the third square. For all the final paintings, the size was somewhat greater than 1920x1080, and seldom had the 16:9 ratio. Thus I could crop most of a painting to the 16:9 ratio, leaving out the color block DALL-E2 puts at the lower right of all its images.

As I got more experience with DALL-E2, I learned that in addition to asking for styles of a certain artist, one may also specify a genre, such as "painting", "digital art", "pixel art" (blocky), "3D render", "clip art" and others. I'll show examples of some of these in future posts.

Monday, August 14, 2023

Worse than climate change, and faster

 kw: book reviews, nonfiction, science, mining, phosphorus

During my grade school years we lived in Salt Lake City, Utah. A few times we visited the Bingham Canyon Copper Mine (AKA the Kennecott Mine), an amazing spectacle. The open pit mine is even larger now than it was then, with an area of about 30 square km, in a ragged oval 9x6 km.

The open pit mine called Phosboucraa, in Western Sahara, about half of which is shown here, is about twice the total size of Kennecott, being 22 km long and mostly between 2 and 3 km wide. The Moroccan company that operates this mine and several others, OCP Group S.A., controls 70% of known world reserves of phosphate rock. However, they're strategically delivering only about 14% of the total ongoing supply, since many other countries, including the U.S., have phosphate mining. Given time, the reserves in Western Sahara will become a virtual monopoly. Let that sink in. Think about that the next time you get some "superphosphate" or "triple phosphate" fertilizer for your garden.

The next image shows the location of the mine in Western Sahara, whose northern border with Morocco is shown dashed, because Morocco claims it, and controls the mining operations. The king of Morocco controls the mining companies (not just OCP), and therefore, more than 80% of the world's phosphate rock.

A discussion of this political and economic quagmire comes midway in the book The Devil's Element: Phosphorus and a World Out of Balance by Dan Egan. He begins with a bit of history of this element that catches fire if it gets to the temperature of bath water, that holds onto oxygen so strongly it takes four O= ions to balance it…and it takes temperatures high enough to nearly melt iron to reduce the oxide to elemental phosphorus.

Before the discussion of the western African mines, we learn of older mining areas such as phosphate-rich oceanic islands and even older "bone beds" in Florida. Some of those are already played out, others will be exhausted soon enough.

What are good sources of phosphorus? Dead things. Phosphorus natively was widely but thinly spread in nature, but is concentrated by living things. All living tissues contain phosphorus. That's you, for example. Mammal meat (muscle) contains from 1/4% to 1/2% phosphorus, and P-rich vegetables such as broccoli contain about 1/16%, mostly in their DNA (carrots come in at 1/30%) and in the ATP/ADP energy-producing system. But our bones have lots more: total phosphorus content of a human body is more than 1% because the minerals in our bones are 18% phosphorus. So old bone beds found worldwide are the sites of many phosphorus mines.

The author shows how phosphorus use developed, not only for fertilizers but also for cleansers (now mostly banned) and, in wartime, for incendiary bombs. Ever heard of eutrophication? It's a fancy word for "green stuff in the water that makes it stink with poisonous fumes." The "green stuff" is mainly cyanobacteria, which used to be called "blue-green algae" but are actually bacteria. I'll call them CB. They are the main source of the stink that comes up a drain if the trap runs dry in an unused sink or shower. Fifty-plus years ago, laundry detergents were the main cause of "algae blooms" (really CB blooms) that turned water green, made it look like overripe guacamole, and it could kill you if you fell in. The Clean Water act led to banning phosphorus in the laundry, but agricultural use was exempted from regulation. Now farms use many times more than in the past, and the runoff is causing even greater problems. 

Many lakes, including Lake Erie, were dying when I lived in Ohio, but were revived when the P runoff was stopped. Now they are in even worse shape. So are parts of the Gulf of Mexico, because the freshwater-plus-pollutants-plus-CB from the Mississippi River pushes out over the salt water of the Gulf, where the CB blooms and makes the beaches in three states unswimmable.

It doesn't have to be that way. In one analysis reported in the book, half of the P fertilizer spread on farm fields runs off before the crop grows, and another nearly 1/4 runs off during the growing season, leaving less than 30% to be taken up into plants. Tilling the post-harvest plant waste back into the soil will at least reclaim that portion. In many cases, that would be enough to bring in a good harvest the following year without adding any new fertilizer. But most farmers are creatures of habit.

There are practices that reduce, and can nearly eliminate, fertilizer runoff. Can long-standing national habits be changed fast enough? Two forces militate against it. One is that tradition dies hard; it's not only in the "Old time religion" that "good enough for Grandpa is good enough for me" holds sway. The other is the mining lobby, that doesn't want demand to be reduced because they are minting billions. If agricultural phosphorus (and nitrogen and potassium, for that matter) were reduced to less than 1/3, multitudes of mining and fertilizer manufacturing workers would need to work elsewhere. It's a big disruption.

Disruption is bound to happen anyway. At the rate of current use, peak production is soon to occur, within a decade or two. Reserves might last for 20-40 years at that point, but they could last centuries if all the world adopted more effective fertilization practices. Recycling food wastes could begin to restore the virtuous cycle that existed before fertilizer-based farming developed. Also, a wholly different style of sewage treatment could reduce the need for mined phosphorus even more (more miners out of work). But if the rocks are all used up, it'll have to be done, or starvation will result. We can't support 8 (or 9) billion humans without fertilizer-based farming…not yet, anyway. But the time will come, probably in the lifetime of people just a little younger than I am, when it must be done, or the population will be reduced by famine (and food riots) everywhere.

That's all likely to happen long before climate change drives everyone north to Canada and Siberia, or south to the southern Kalahari (which could be lots wetter soon) and the southern Pampas of Argentina. Get this book and consider carefully the author's revelations to us.

Wednesday, August 09, 2023

Stories surrounding the rocks

 kw: book reviews, nonfiction, rocks, minerals, stories, legends, surveys

This is a shelf of my own Lapidarium (rock collection), chosen for its variety. If you click on the image you can see a larger version.


As a rock collector I have eclectic tastes. Here are minerals, fossils, sliced-and-polished geodes, and a few crystal clusters that were grown in a jar (such as the deep blue at bottom center: copper sulfate, which occurs in nature in very arid regions as the water-soluble mineral chalcanthite).

The word "lapidarium" is quite obsolete, but is found, very fittingly, in the title of a recent book, Lapidarium: The Secret Lives of Stones by Hettie Judah. Ms Judah writes primarily about art, particularly the stories surrounding artworks; here, the artworks are natural stones and modified stones.

Sixty stones, loosely so-called, are surveyed in six sections, with the themes Power, Sacredness, Evocativeness, Technology, Sculpture, and Life. Life? Consider Coral. In a game of Twenty Questions, the answer to the obligatory opening question, "Animal, vegetable, or mineral?" is "Yes" or "All". The polyp animal, bearing symbiotic algae in its tissues, secretes a mineral skeleton. The deep red skeleton of precious coral, so sought after by kings of old, is colored by pigments derived from the algae. You can only get away with this once.  The Life section also mentions Pearl and Blue Lias; the latter is a heavily fossiliferous shale on England's Jurassic Coast. A few examples from the other sections:

Power: Powerful people like gemstones such as emerald, ruby and sapphire. Note that ruby and sapphire are both corundum (aluminum oxide), with different minor impurities that confer their colors. So this is clearly not a mineralogy book. I firstly thought that Old Red Sandstone was an odd choice; it turns out that the famed Stone of Scone, where Scottish kings were anointed, is a big block of Old Red Sandstone.

Sacredness: Pele's Hair, a type of spun glass from volcanic lava fountains, is sacred to the Hawaiians. Sarsen is silicified sandstone (much tougher than the usual calcite-cemented sort) that makes up the larger stones at Stonehenge. Cinnabar, or mercury sulfide, is a bright red mineral that was used to make scarlet pigment for cosmetics and the clothing for royals and ecclesiastical officers (and poisoned a number of them). Tuff was used to form the Moai, the standing sculptures on Rapa Nui (AKA Easter Island). I must mention that, while the article mentions a study in 1997 of moving one of the statues using ropes, a sledge, and banana-juice lubricant, the moai actually "walked". See this 2013 video. It is a clip from a longer presentation.

Evocativeness (the section is called Stones and Stories): Lapis Lazuli, translated "azure-colored stone", was also a stone of power, but later became better known as the source of Ultramarine pigment for the intense blue and indigo colors in paintings of the great masters. Phonolite Porphyry is a "ringing stone" that makes up the substance of Devil's Tower in Wyoming. Tap a piece with a smaller stone and it will ring like a gong or bell. So will most of the Dolerite stones that make up the inner circle at Stonehenge, and there is a field of ringing stones in eastern Pennsylvania.

Sculpture: Gypsum (usually as alabaster), chalcedony, onyx, and crystalline quartz are among the stones favored for carving and sculpting into artworks. Red Ocher, a mix of red hematite and other iron oxides, may have been used for art tens of thousands of years ago, both as a pigment and as a material to sculpt.

Technology: Flint may be the basis of the oldest technology, that of making edged tools of stone by knapping; the article is mostly about a modern flint knapper who became so skilled, many museums have his counterfeits on display. Obsidian may be equally old, but its occurrence is not as widespread. Lodestone, magnetic ferrous (Iron II) oxide, appears to have a nearly 1000-year history as an aid to navigation. Coltan, an ore containing niobium (columbium) and tantalum, is still in heavy use for electronics. Mica, particularly the clear, colorless form called muscovite (named for Moscow), was used for oven door windows because it is heat resistant; in such a use it was called Isinglass.

This is a fun, well-written book, not about rocks per se, but about stories about rocks.

Saturday, August 05, 2023

A survey of marine life with its own earworm

 kw: book reviews, nonfiction, marine animals, animal life, natural history, surveys

I wrote in the prior book review that a naturalist ought to be able to draw and paint. To write a book of natural history such arts are also necessary, and if one cannot self-produce the illustrations, one must have a good artist on call. Fortunately, Dr. Helen Scales was able to call on Marcel George to produce the lovely artwork in Around the Ocean in 80 Fish & Other Sea Life. The book is the latest in a series of "Around the World in 80" something (Trees, Birds, etc.). It also has kept a certain tune in my head for several days now! Here is the Bing Crosby rendition.

The suffix "& other sea life" is well put. Just for fun I compiled the non-fish:

  • 16 mollusks, from octopuses and a squid to oysters, clams, snails and sea slugs
  • 5 mammals, such as whales and dugongs
  • 4 crustaceans, from krill to crabs
  • 2 cnidarians: a coral and a jelly (AKA "jellyfish")
  • 2 echinoderms: a starfish and a sea cucumber
  • and one each sponge, siphonophore (Portuguese man-o-war), and annelid (segmented worm)

That leaves 48 actual fish. Each animal or animal group is depicted on a two page spread, such as this one for Parrotfish. This item has a little more text than usual; the average is one page of the two.


From time to time there is a full two page illustration, such as this one of nudibranchs, which are sea slugs, but there are a number of categories of sea slugs besides nudibranchs.


Considering that there are tens of thousands of fish species, around 100,000 mollusk species, and some 10,000 cnidarians, a book like this isn't even a "tip of the tip of the iceberg", but a smattering of things to entice our appetite for more marine natural history. The little articles are full of tidbits, such as the naming of the Ninja Lanternshark (Etmopterus benchleyi) by some 8-year-olds, because its lighting scheme makes it extra-sneaky; that many of the 60 species of flying fish can glide above the waves for several hundred meters and are as aerodynamically efficient as a hawk; or that the "bone" that stiffens the mantle of a cuttlefish is sometimes used in jewelry making.

And just by the way, cuttlefish display at least as much self-control as a human child in a marine version of the Marshmallow Test. Certain fish also pass the Mirror Test, recognizing that the image in the mirror is themselves. There's much more going on in the ocean than most of us could ever imagine. A book like this expands our imaginations, and I hope it leads some to learn more and further expand.

Thursday, August 03, 2023

A quick read, but you're bound to learn something new about animals

 kw: book reviews, nonfiction, animals, anatomy, lifestyles, natural history

During the era of "natural philosophy" every naturalist could draw and paint. There was no photography; later it was possible but too costly. The best naturalists still draw for their notebooks and paint for their publications.

These two notebook pages are examples produced a century apart, in 1806 and 1915. The Eulachon fish was drawn by Meriwether Lewis in Oregon, and the contour map was drawn by Joseph Grinnell in California.

The book Wildlife Anatomy: The Curious Lives & Features of Wild Animals Around the World was written and illustrated by Julia Rothman. On the cover she notes "With help from Lisa Hiley", which refers to helping with research.

The subject is anatomy in the broadest sense, because here we learn also about life habits and environments, tools and architecture. "Architecture?", one might say. Yes, beavers and mound-building termites are architects, as are nest-making birds. The level of consciousness may vary, but the creativity cannot be denied.

Here is one 2-page spread that is about anatomy per se. There are sections on antlers, teeth, claws, wings, etc., also.

Well under half the page space is taken up by text, and some spreads are wordless, so if one is strictly reading, this is a very fast read. But it is worth dwelling on the features of the illustrations. This is no novel to race through.

For a writer who is so sparse with words, Ms Rothman packs plenty of meaning into every sentence. And what, one may say, did I learn that was new to me? Several things, but the most fun is the tidbit that star-nosed moles smell underwater "by blowing out and quickly re-inhaling bubbles of air." For a blind mole that hunts by smell, that is an advantage.

If you want to be a naturalist, I suggest learning to draw at a very early age, and keeping at it as long as you live. If you feel you lack artistic talent, take classes; the little bits of artistic talent found in all of us can be shaped and trained. Meriwether Lewis was no Michelangelo, but he didn't need to be. Once you've seen his drawing of a Eulachon fish (a type of smelt), when you see one, you'll recognize it.

Tuesday, August 01, 2023

Foreseeing a new Earth

 kw: book reviews, speculative fiction, climate change, geoengineering, sociology

Finally! Something on which former President Barack Obama and I agree!! He likes the book, and I like the book: The Ministry for the Future by Kim Stanley Robinson. I suspect if we were to sit down over a cuppa and talk about it, the President and I would find that our reasons for liking it differ substantially. Oh, well.

The climate is changing, that we can nearly all agree on, because that is what the climate does; it is how climate is defined. What is driving the change, hardly anybody agrees on (the so-called "scientific consensus" covers enormous in-fighting in the "climate science" crowd). At present, rising carbon dioxide is the favored culprit. In my view, carbon dioxide is significant, but not decisive.

It must be noted that the temperature swing of around 5°C between the Medieval Climate Warming of around 1,000 years ago (~950AD to ~1250AD in Europe and North America), and the Little Ice Age that began about 200 years later (~1450AD to ~1850AD) occurred during a time of utterly stable carbon dioxide concentration in the atmosphere. Furthermore, the Maunder Minimum, a period of exceedingly low sunspot activity, occurred from about 1645AD to 1715AD, right in the middle of that cool-down. The 22-year sunspot cycle, plus poorly known longer-term cycles in the Sun, together with the three longer-term orbital-mechanics Milankovitch cycles, are the primary external climate drivers.

The premise of MftF (an abbreviation used in the book) is that rising carbon dioxide concentration is the only relevant driving force of post-Industrial Revolution climate warming. Let's grant the author that for the nonce and see where it leads, because the book is full of fascinating ideas, some of which may prove useful.

The book opens with a hot weather disaster in India in which 20 million die. The government of India responds by unilaterally carrying out a bit of geoengineering: at great cost, they have thousands of airplanes release sulfate aerosols into the stratosphere in what is later called a "double Pinatubo". It works for a while, cooling India and the northern hemisphere for several years. Several chapters describe the futile politicking that goes on around this event. In the midst of it all, a new agency of the UN is formed, the Ministry for the Future. Its leader, Mary Murphy, and her staff, are central figures in the rest of the book. Its bailiwick is to act on behalf of future generations, and indirectly, for the nonhuman species being driven by the hundreds into extinction by human economic activities.

The book covers about a 25-year span, from 2-3 years from now (call it 2026) until the late 2040's. One thing author Robinson likes is lists. Numerous chapters contain lists: Chapter 85 mostly consists of the names of greening and restoration projects in many countries from Argentina to Zimbabwe (and most of them are real already), taking up 4 pages; sundry lists of possible geoengineering projects including Chapter 71 which focuses on putting yellow dye in the Arctic Ocean to keep it from warming by absorbing sunlight; in Chapter 30 the author ruminates on what to call the turning point (the Great Turn, the Trembling 20's...) and devotes a page to a list of lists, of the various ways the past has been divided into a list of periods; Chapter 20 discusses several (numerous) alternatives to GDP as a measure of prosperity.

Where Robinson really shines is the ability to write in numerous voices. While many of the chapters are third-person narrative, more are first-person soliloquy in the voices of key characters and others including unidentified refugees—several thereof—which instantly forge emotional bonds with readers, bringing us into the story. Some of the soliloquys are personified objects: the Market, the Blockchain, a Photon, a Carbon atom, and a puzzle that, I think, refers to the total number of base pairs in the DNA of an entire person (Chapter 95; the key is the words "sextillions" and "spiral").

I take issue with the soliloquy of a Carbon atom: it claims it was forged in a supernova. Carbon is formed in main-sequence stars during the red giant phase of helium burning. Thereafter, there are two scenarios that produce most supernovae. One is the Type Ia, in which a white dwarf star, which consists mostly of carbon and oxygen (the ratio depends on the mass of the original star), orbits with a companion star that has yet to become a red giant. When the companion swells into a red giant, much of its material is swept onto the white dwarf, increasing its mass until it reaches the Chandrasekhar limit of mass, upon which it explodes, ejecting much of its mass while the core becomes a neutron star. During the explosion, elements of all masses are formed, but very little of that is likely to be carbon because the already-existing carbon is instead forged into silicon and other heavier elements. The other is Type II, in which a very heavy star burns beyond carbon and oxygen, through silicon and the transition metals until it has an iron core; once the core cannot be further "burned", the star implodes and rebounds, forging elements of all masses, primarily heavier ones. It's where gold comes from, for example. Thus, Chapter 66 should state that the carbon atom in question was formed in the core of a red giant until it was left behind in the substance of a white dwarf, but then later ejected in a Type Ia supernova. Perhaps it escaped during the ejection of the red giant's atmosphere, but that would have contained little carbon.

My favorite of the geoengineering methods is one told part by part through several chapters: drilling through the Antarctic icecap to pump water from beneath the ice up onto flat places and internal basins, where it freezes. This is to remove the lubrication from Antarctic glaciers and re-ground them to slow their movement. In the book it works, and I think it really would work.

A current running through the book involves terroristic activities by "the Children of Kali". It is not clear whether all the events that seem to emanate from them are really theirs, because a "black wing" of the Ministry for the Future, led by a fellow named Badim, probably also carried out targeted assassinations. This is implied but kept out of sight.

Robinson likes happy endings, so (mild spoiler alert) the book ends with carbon dioxide levels being reduced as great numbers of mitigation efforts take effect. Global population is also decreasing by 2050. I had to keep in mind that, from the disaster of the mid-2020's onward, this book is a world-building exercise. Many of the things therein are possible, some quite unlikely, but the positive polemical point of the book is clear: if we are to make an effective change in the trajectory of the climate, numerous efforts of many kinds will be needed. There is no silver bullet. 

I was unhappy with a near-absence of nuclear energy. It comes up only in Chapter 76, when a Navy officer discusses these facts: 83 nuclear powered ships and subs, over 5,700 reactor-years, and 134 million miles of travel, with nary a nuclear accident. "Probably the Navy should run the country's electricity system." Personally, I've been in favor of that for a long time. Electricity would cost more than it does now, because the Navy places more of a priority on safety, compared to the folks who ran Three Mile Island or Chernobyl. I am in favor of using breeder reactors to turn U238 into Plutonium even as the U235 is being used to make energy; I favor recycling radioactive waste to extract even more fuel and reprocess it. This would be an energy source that would more than bridge the gap between the largely carbon-based system we have now and a non-carbon, non-nuclear future system, with nuclear waiting in the wings if needed. I hope for a world in which hydrocarbon and coal are being deposited faster than we use them (for chemicals, not for fuel).

Robinson's message is clear. In this possible future Earth, whether we make it more livable, or less, is up to us. I agree.