Algorhythmic Art ImaGenator
Algorhythmic Art ImaGenator
For those who seek surprise and beauty by generating never seen imagery, using automation enhanced by human selection.
One image in, many images out. Rinse and repeat (load saved images from early sessions to expand the generative possibilities in later sessions. Evolution, with the artist (you) in the role of natural selection!).
Use your preferences to choose starting images and keep images that you value. The tool will save all generated images - you may end up deleting many, but look at them closely - some will surprise you more than their thumbnail indicates.
Click inside each code section, then key in <shift><enter>, wait for code to run, then move to next section. Some sections take longer than others - smaller image sizes will run faster.
One image in, many images out. Rinse and repeat (load saved images from early sessions to expand the generative possibilities in later sessions. Evolution, with the artist (you) in the role of natural selection!).
Use your preferences to choose starting images and keep images that you value. The tool will save all generated images - you may end up deleting many, but look at them closely - some will surprise you more than their thumbnail indicates.
Click inside each code section, then key in <shift><enter>, wait for code to run, then move to next section. Some sections take longer than others - smaller image sizes will run faster.
In[]:=
(*UsefulAestheticInitializations-clickinsidethiscommentthenpress<shift><enter>*)Clear["Global`*"];(*ImageEffectre-orderingandtweakstodefaults-consultWolframdocumentationbeforechanging*)paramaterizedEffectDefaults=Partition[Riffle[Range[Length[ImageEffect[]]],ImageEffect[]],2];effectArrangement=ImageEffect[][[#]]&/@{6,2,8,15,23,19,17,27,13,14,21,3,26,7,20,5,1,4,24};paramaterizedEffectDefaults=effectArrangement/.{"Charcoal"{"Charcoal",3},"Comics"{"Comics",{0.03,0.15}},"MotionBlur"{"MotionBlur",15,0.45},"Jitter"{"Jitter",7},"NestedComposition"{"NestedComposition",17,0.95,Pi/12,{0.52,0.48},{0.58,0.42}},"OilPainting"{"OilPainting",5},"Posterization"{"Posterization",10},"SaltPepperNoise"{"SaltPepperNoise",0.15},"Solarization"{"Solarization",0.6},"Stippling"{"Stippling",7}};(*Initializations*)numSizeDivisions=3;localResolution=Flatten["FullScreenArea"/.SystemInformation["Devices","ScreenInformation"]][[{2,4}]];maxPixelWidth=IntegerPart[(localResolution[[1]]/2)];midPixelWidth=IntegerPart[maxPixelWidth/2];minPixelWidth=IntegerPart[maxPixelWidth/6];animationLength=5;animationRepetitions=3;
Choose a colorful image already loaded on your computer:
Choose a colorful image already loaded on your computer:
In[]:=
(*Inputimage-clickinsidethiscommentthenpress<shift><enter>*)myImage=Image[Import[SystemDialogInput["FileOpen",WindowTitle"Choose an image already loaded on your computer"]]];If[ListQ[myImage],myImage=First[myImage]];myImagemyImageWidth=First[ImageDimensions[myImage]];
Enter a base filename to store pdf and mp4 outputs (customize at will, before keying <shift><enter>) :
Enter a base filename to store pdf and mp4 outputs (customize at will, before keying <shift><enter>) :
In[]:=
(*Filesetup*)baseOutputFileName="trumpetFlower";baseOutputImageExtension=".pdf";baseOutputMovieExtension=".mp4";
Select an existing directory folder to save outputs:
Select an existing directory folder to save outputs:
In[]:=
outputDirectory=SystemDialogInput["Directory"](*Outputfunctions*)putOut[image_]:=Export[StringJoin[outputDirectory,baseOutputFileName,baseOutputImageExtension],image,OverwriteTarget"KeepBoth"];putOut[imageS_List]:=Export[StringJoin[outputDirectory,baseOutputFileName,baseOutputMovieExtension],imageS,OverwriteTarget"KeepBoth"];
Then let the automation work, clicking inside each code section before keying <shift><enter>:
Then let the automation work, clicking inside each code section before keying <shift><enter>:
In[]:=
minSizedImage=ImageResize[myImage,minPixelWidth,Resampling"NearestRight"];midSizedImage=ImageResize[myImage,midPixelWidth,Resampling"NearestRight"];maxSizedImage=ImageResize[myImage,maxPixelWidth,Resampling"NearestRight"];Print["Original width in pixels is ",myImageWidth," ",myImage];Print["Minimum width in pixels is ",Max[minPixelWidth,100]," ",minSizedImage];Print["Medium width in pixels is ",midPixelWidth," ",midSizedImage];Print["High res width in pixels is ",maxPixelWidth," ",maxSizedImage]
Zoom in or out of any image by selecting it and dragging any edge or corner.
More <shift><enter> follows:
Zoom in or out of any image by selecting it and dragging any edge or corner.
More <shift><enter> follows:
More <shift><enter> follows:
In[]:=
Print["Show each effect applied to minimum, medium, large and original images"];Print["Minimum, ",minPixelWidth," pixels wide"];effectedSmallImageListing={ImageEffect[minSizedImage,#],#}&/@paramaterizedEffectDefaultsListAnimate[effectedSmallImageListing,0.8,AnimationRepetitionsanimationRepetitions,DisplayAllStepsTrue,AnimationDirectionForward,ImageSizeFull]effectedSmallImages=effectedSmallImageListing[[#]][[1]]&/@Range[Length[effectedSmallImageListing]];
<shift><enter>:
<shift><enter>:
In[]:=
putOut[#]&/@effectedSmallImages;putOut[effectedSmallImages];
<shift><enter>:
<shift><enter>:
In[]:=
Print["Medium, ",midPixelWidth,"pixels wide"];effectedMidImageListing={ImageEffect[midSizedImage,#],#}&/@paramaterizedEffectDefaultsListAnimate[effectedMidImageListing,0.8,AnimationRepetitionsanimationRepetitions,DisplayAllStepsTrue,AnimationDirectionForward]effectedMidImages=effectedMidImageListing[[#]][[1]]&/@Range[Length[effectedMidImageListing]];
<shift><enter>:
<shift><enter>:
In[]:=
putOut[#]&/@effectedMidImages;putOut[effectedMidImages]
<shift><enter>:
<shift><enter>:
In[]:=
Print["Large, ",maxPixelWidth,"pixels wide"];effectedLargeImageListing={ImageEffect[maxSizedImage,#],#}&/@paramaterizedEffectDefaults;ListAnimate[effectedLargeImageListing,0.8,AnimationRepetitionsanimationRepetitions,DisplayAllStepsTrue,AnimationDirectionForward]effectedLargeImages=effectedLargeImageListing[[#]][[1]]&/@Range[Length[effectedLargeImageListing]];putOut[#]&/@effectedLargeImages;putOut[effectedLargeImages]
<shift><enter>:
<shift><enter>:
In[]:=
Print["Original size, ",myImageWidth,"pixels wide"];effectedOriginalImageListing={ImageEffect[myImage,#],#}&/@paramaterizedEffectDefaults;ListAnimate[effectedOriginalImageListing,0.8,AnimationRepetitionsanimationRepetitions,DisplayAllStepsTrue,AnimationDirectionForward]effectedOriginalImages=effectedOriginalImageListing[[#]][[1]]&/@Range[Length[effectedOriginalImageListing]];putOut[#]&/@effectedOriginalImages;putOut[effectedOriginalImages];
<shift><enter>:
<shift><enter>:
In[]:=
Print["If needed, increase window magnification or enlarge each image to see detail differences.\n"];Partition[Riffle[effectedSmallImages,effectedMidImages],2];Partition[Flatten[Riffle[%,effectedLargeImages]],3];Partition[Flatten[Riffle[%,effectedOriginalImages]],4]
<shift><enter>:
<shift><enter>:
In[]:=
Print["ColorToneMapping"];ctmMax=ColorToneMapping[myImage,#]&/@{0.01,0.5,1.0}putOut[#]&/@ctmMax;
<shift><enter>:
<shift><enter>:
In[]:=
Print["Edge Detection"];EdgeDetect[myImage,#1,#2]&[4.2,0.145]putOut[%];EdgeDetect[myImage,#1,#2]&[4.7,0.03]putOut[%];
<shift><enter>:
<shift><enter>:
In[]:=
Print["Collage"];ImageCollage[Join[effectedSmallImages,ctmMax]]putOut[%];ImageCollage[Join[effectedMidImages,ctmMax]]putOut[%];ImageCollage[Join[effectedLargeImages,ctmMax]]putOut[%];ImageCollage[Join[effectedOriginalImages,ctmMax]]putOut[%];
<shift><enter>:
<shift><enter>:
<shift><enter>:
<shift><enter>:
The following may take a long time - be willing to wait before keying <shift><enter>) :
The following may take a long time - be willing to wait before keying <shift><enter>) :
Ditto above applies extra below - patience during <shift><enter>:
Ditto above applies extra below - patience during <shift><enter>:
<shift><enter>:
<shift><enter>:
<shift><enter>:
<shift><enter>:
<shift><enter>:
<shift><enter>:
<shift><enter>:
<shift><enter>:
<shift><enter>:
<shift><enter>:
Pick some winners and repeat!
Pick some winners and repeat!