avatarTim Han

Free AI web copilot to create summaries, insights and extended knowledge, download it at here

4405

Abstract

er based on the prompt “A Dan Flavin art of a rabbit”.</figcaption></figure><p id="2b9b">It’s a beauty. Simple, poetic, surprising. The reference to Dan Flavin creates an atmospheric, illuminated render of the rabbit. I could see this as a piece in my own space.</p><p id="16cf" type="7">“An Isamu Noguchi art of a rabbit”</p><figure id="8d22"><img src="https://cdn-images-1.readmedium.com/v2/resize:fit:800/1*gj4fxhoA7HyROuRpYyb8Ig.png"><figcaption>A DALL-E render based on the prompt “An Isamu Noguchi art of a rabbit”.</figcaption></figure><p id="113c">Stunning. There is a bit of surrealism in the form itself, but it’s an impressive concept of a rabbit.</p><p id="03ce" type="7">“A Barbara Hepworth sculpture of a rabbit”</p><figure id="4eee"><img src="https://cdn-images-1.readmedium.com/v2/resize:fit:800/1*7LOC2oigQDzizr7kBf2stg.png"><figcaption>A DALL-E render based on the prompt “A Barbara Hepworth sculpture of a rabbit”.</figcaption></figure><p id="7855">This render looks right out of the imaginary sculpture park itself. The texture is amazingly realistic, the composition is dynamic. In its poise, the rabbit displays a big personality.</p><h1 id="830a">Defining the three-prong prompt: A sculptural reference, persona, and an action</h1><p id="5b77">Now that we’ve explored a basic static DALL-E render of a sculptural reference, we can expand the prompt with a third contextual element, <b>action</b>.</p><p id="56be">We’ll ask for the rabbit to be active, jumping, or leaping.</p><figure id="3b09"><img src="https://cdn-images-1.readmedium.com/v2/resize:fit:800/1*lYLI6loWGLuEmEit8uZNKw.png"><figcaption>Adding ‘action’ to the initial prompt. This defines the 3-prong approach for the prompt.</figcaption></figure><p id="2f0c">Defining an action for our persona will add fluidity and spatial aspects. We can describe the action as leaping, or jumping through the air.</p><p id="360c">The prompts for DALL-E are thus:</p><p id="e870" type="7">“A Dan Flavin art of a rabbit leaping through the air”</p><figure id="a91c"><img src="https://cdn-images-1.readmedium.com/v2/resize:fit:800/1*OhgL44MaPkgu2NcnBBcPwA.png"><figcaption>A DALL-E render based on the 3-prong prompt “A Dan Flavin art of a rabbit leaping through the air”.</figcaption></figure><p id="1c1b">DALL-E rendered this beautifully based on the 3-prong input. The image has a cinematic, ethereal quality. While we’re not sure where this narrative is going, it can be the take-off point for the rabbit hero story.</p><p id="ac7b" type="7">“An Isamu Noguchi sculpture of a rabbit jumping through mid air”</p><figure id="5b4e"><img src="https://cdn-images-1.readmedium.com/v2/resize:fit:800/1*-tfcnwiVkpOpni9ziPb53Q.png"><figcaption>A DALL-E render based on the 3-prong prompt “An Isamu Noguchi sculpture of a rabbit jumping through mid air”.</figcaption></figure><p id="9b64">In this DALL-E image, the hero, the rabbit is taking on a playful personality, jumping into the air, escaping the picture, leaping into his freedom. Action here defines the hero as having energy and aspirations.</p><p id="6506" type="7">“A Barbara Hepworth sculpture of a rabbit jumping”</p><figure id="60fc"><img src="https://cdn-images-1.readmedium.com/v2/resize:fit:800/1*tn92Rom8N8RRMEy5-MTVvg.png"><figcaption>A DALL-E render based on the 3-prong prompt “A Barbara Hepworth sculpture of a rabbit jumping”.</figcaption></figure><p id="c4a3">This DALL-E rabbit seems to be dancing on his concrete cube, excited to be in this park-like environment. The action here adds delightfulness and subtlety.</p><h1 id="0612">Defining the four-prong prompt: The sculptural reference, persona, action, and environment</h1><p id="600e">We can expand a 3-prong set-up to include any other attribute. We can set the stage by defining the surroundings, colors, expression, background, textures, and so many other aspects.</p><figure id="44e0"><img src="https://cdn-images-1.readmedium.com/v2/resize:fit:800/1*_LiLU-WRYZnBBdfaLNyXCQ.png"><figcaption>An illustrative outline of a 4-prong approach to crafting the prompt. This includes the sculptural style reference, the hero (rabbit), the action, and the environment.</figcaption></figure><p id="b24a">For this exploration, we define the environment on the Barbara-Hepworth-inspired dancing rabbit.</p><p id="5bd8" type="7">“A Barbara Hepworth sculpture of a rabbit diving into a big swimming pool”</p><figure id="cc8

Options

f"><img src="https://cdn-images-1.readmedium.com/v2/resize:fit:800/1*VM3eVfQ3YmXeriXWTUAQBA.png"><figcaption>A DALL-E render based on the 4-prong prompt “A Barbara Hepworth sculpture of a rabbit diving into a big swimming pool”.</figcaption></figure><p id="0744">It’s a nice rendering, although it took a few rounds to get a render of the rabbit’s entire body. The form of the sculpture is lovely, smooth, and artistic. I could see this sculpture in someone’s swimming pool.</p><p id="3c60">This can become an idea for a prototype. Or it can be a visual cue for a story that yet has to be written.</p><p id="58a0">Expanding on the prompts can add interesting dimensions, although it will take several tries before DALL-E can loosely match one’s expectation, even on a rudimentary level.</p><h1 id="f09d">Learnings and takeaways</h1><p id="e758">DALL-E renders take time (and money). They need a meaningful prompts to make a render valuable to the designer.</p><p id="ea35">Crafting a prompt takes a conceptual input. We need to define our expectations of a DALL-E render. (Randomness is fine, but unsurprisingly, the outcome is unpredictable).</p><p id="4faf">It is important to know the artistic style references well. Read up about artists’ and their work and look images of their oeuvre. Delve into their universe that took them decades to create.</p><p id="6c89">Study art history, visit museums, attend art lectures, research art movements. It will come in handy when you need to write design inputs.</p><p id="47f6">Keep being amazed by what you see around you and make a note of it.</p><p id="2ce2">Experiment with the prompt, but don’t ask for the impossible. Remember, DALL-E pulls from open source databases. DALL-E doesn’t have the human ability to bend its mind around corners.</p><p id="5f04">Remain humble and always remember, DALL-E does not replace the human imagination and creative mind. DALL-E is a tool. We can use it to explore.</p><p id="bd7b">Above all, enjoy the journey into AI.</p><p id="87ca">And then, take a break from it all.</p><p id="734f"><b>Interested in learning more about UX design, AI, design tools & trends, and art? Join Medium with <a href="https://evaschicker2012.medium.com/membership">this link</a>, and support my future writing. Thank you! </b>✍️🧡</p><p id="7ff8"><i>All images created with DALL-E ©Eva Schicker 2023.</i></p><p id="be5c">Read more about AI and design:</p><div id="f8f5" class="link-block"> <a href="https://evaschicker.medium.com/applying-abstract-art-references-to-dall-e-as-stylistic-concepts-55a000660f8c"> <div> <div> <h2>Applying abstract art references to DALL-E as stylistic concepts</h2> <div><h3>5 explorations on how DALL-E’s AI is interpreting modernist art styles</h3></div> <div><p>evaschicker.medium.com</p></div> </div> <div> <div style="background-image: url(https://miro.readmedium.com/v2/resize:fit:320/1*FJxhtMEaieIBKV-Tqsu18w.jpeg)"></div> </div> </div> </a> </div><div id="144e" class="link-block"> <a href="https://evaschicker.medium.com/how-to-explore-the-golden-ratio-in-design-and-typography-b124331ba378"> <div> <div> <h2>How to explore the golden ratio in design and typography</h2> <div><h3>The secret lies in 1.61803398875</h3></div> <div><p>evaschicker.medium.com</p></div> </div> <div> <div style="background-image: url(https://miro.readmedium.com/v2/resize:fit:320/1*6VIjPYDeIFm-JvSKNYg50g.jpeg)"></div> </div> </div> </a> </div><div id="770e" class="link-block"> <a href="https://evaschicker.medium.com/creating-steam-in-css-d8641ba7525c"> <div> <div> <h2>Creating steam in CSS</h2> <div><h3>Think hot, delightful, freshly brewed coffee</h3></div> <div><p>evaschicker.medium.com</p></div> </div> <div> <div style="background-image: url(https://miro.readmedium.com/v2/resize:fit:320/1*VuQaTsutYWfyUueWNHz2aQ.gif)"></div> </div> </div> </a> </div><p id="0bce">Thank you.</p></article></body>

JavaScript: Array Methods Cheatsheet

Here is a list of most common array methods in JavaScript.

// Mutating
push()      // Insert an element at the end
pop()       // Remove an element from the end
unshift()   // Inserts an element in the beginning
shift()     // Remove first element
// Iterating
forEach()   // Iterates an array
filter()    // Iterates an array and result is filtered array
map()       // Iterates an array and result is new array
reduce()    // "Reduces" the array into single value (accumulator)
// Others
slice()     // Returns desired elements in a new array
concat()    // Append one or more arrays with given array

Mutating Methods

There are many array methods that mutate the array. Mutating an array means that the resulting array will take a different form from before similar to English definition of mutation. So let’s take a look at some of the most common ones:

push()

const array = [1, 2, 3, 4]
array.push(10) // 5 (push returns the length of the new array)
// array = [1, 2, 3, 4, 10]

push method will insert the element passed at the end of the array and return the length of the new array.

pop()

const array = [1, 2, 3 , 4]
array.pop() // 4 (pop returns the element removed)
// array = [1, 2, 3]

pop method will remove the last element in the array and return that element.

unshift()

const array = [1, 2, 3, 4]
array.unshift(9, 10) // 6 (unshift returns the length of new array)
// array = [9, 10, 1, 2, 3, 4] 

unshift method will add the elements passed at the beginning of the array preserving the order and return the length of the new array.

Note: You can pass in as many elements as you like to the function.

shift()

const array = [1, 2, 3, 4]
array.shift() // 1(shift returns the removed element)
// array = [2, 3, 4]

shift method will remove the first element array and return the removed element.

Iterating Methods

Iterating methods are very powerful because iterating through an array is one of the most common instructions that we want to execute. So let’s take a look at some of them:

forEach()

const array = [1, 2, 3, 4]
array.forEach((elemnt, index) => {
   console.log(`Element ${element} at index ${index}`)
}

forEach method will call the function provided once for each element in the array preserving the order. This function provided can take in 3 different arguments: element, index, array. Be sure that the order in which you pass these parameters follow the order.

filter()

const array = [1, 2, 3, 4]
const filteredArray = array.filter(element => element%2)
// array = [1, 2, 3, 4]
// filteredArray = [1, 3]

filter method will return a brand new array with elements that returned true from the function provided. Notice that in the example above, the function passed into the filter method returns true if element is odd which is why you see that filteredArray is [1, 3].

Note: filter method doesn’t mutate the original array. It will create a new array.

map()

const array = [1, 2, 3, 4]
const mapArray = array.map(element => element * 2)
// array = [1, 2, 3, 4]
// mapArray = [2, 4, 6, 8]

map method will create a new array of elements where each element is a value returned from the function provided. The example above shows the function provided doubling each element. Hence, mapArray is [2, 4, 6, 8].

Note: just like filter method, map will not mutate the original array because it will create a new array.

reduce()

const array = [1, 2, 3, 4]
const result = array.reduce((accumulator, current) => (
   accumulator + current
), 10)
// array = [1, 2, 3, 4]
// result = 20

reduce method will take in reducer function and initial value as arguments. The reducer function can take up to 4 arguments: accumulator, element, index, and array. The reducer function will be executed for each iteration and the returned value of each iteration will be used for the next iteration.

Note: reduce method returns a single value not an array.

Others

Lastly, there’re couple of more methods that are super important to know and very common in JavaScript codebase.

slice()

const array = [1, 2, 3, 4]
const slicedArray = array.slice(0, 2)
// array = [1, 2, 3, 4]
// slicedArray = [1, 2]

slice method will create a new array with elements from the index range passed in. In the example above, we specify the start index (0) and the end index (2) which gives us a new array [1, 2]. Also, notice that the original array isn’t mutated.

Note: End index is exclusive which means that the element at that end index isn’t included in the new array.

concat()

const array = [1, 2, 3, 4]
const concatArray = array.concat([5, 6, 7, 8])
// array = [1, 2, 3, 4]
// concatArray = [1, 2, 3, 4, 5, 6, 7, 8]

concat method will create a new array containing all the elements in the original array followed by the each of the arrays that are passed in. This method will not mutate the original array.

Note: You can pass in more than one array as arguments.

We went over some of the most common JavaScript array methods through this little cheatsheet and hopefully this is helpful for a lot of you. There are a lot more array methods available in JavaScript other than the ones we went over that are just as useful if not more which you check out in the documentations like MDN.

JavaScript
Arrays
Cheatsheet
Programming
ES6
Recommended from ReadMedium