-
Notifications
You must be signed in to change notification settings - Fork 0
/
README
254 lines (162 loc) · 9.44 KB
/
README
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
LENNON MOSAIC APPLICATION STORIES
=================================
User/Role Contexts:
SysAdmin - System admin works with the Mosaic from the command line
Admin - Admin works with the mosaic from the application interface
System - Behind the Scenes processing
User - 3rd party visitor who views and interacts with the Mosaic
Classes:
Mosaic - The main class, responsible for creating and managing the Mosaic itself
Source - Class representing a source of image content, this class is responsible for pulling the new content
Image - Class representing a single image
Other:
The Application - the website interface for both viewing and managing the Mosaic
------------------------------
Iteration Descriptions
------------------------------
Step One: will mostly be run by me at the command line to get the project off the ground, make sure the actual image manipulation parts are working and compiling the mosaic properly and the outputted image is what we want it to be. This section will be tested using a single image feed from photobucket.
Step Two: will be to add genuine feedback to the script so that we can see what is happening as we go along. This process takes a considerable amount of time, so good user communication will be key.
Step Three: will then be to add the ability to record and save the information on the images, save the master image, and generate the new mosaic from the existing data. This step is expected to speed up the image creation process.
Step Four: will be adding multiple Image feed sources to the Mosaic engine. At this point we will add the Creative Allies feed and the YouTube feed.
Step Five: will be to enhance the presentation of the mosaic into both a standard output image and a javascript driven interactive table which will (hopefully) look feel and work like the YouTube flash based one.
Step Six: will be to move all of this into the Creative Allies application and create the ability for any admin (You, Josh, etc.) to manage the image sources and images used to create the mosaic.
------------------------------
1. Get It Working
------------------------------
Get It Working will mostly be run by me at the command line to get the project off the ground, make sure the actual image manipulation parts are working and compiling the mosaic properly and the outputted image is what we want it to be. This will establish the basic test suite and code library and will include local files for testing.
1. SysAdmin Instates the Class
The SysAdmin starts the script and it has a master image and a source.
2. SysAdmin Assigns A Master
The SysAdmin assigns the Master Image to an Instance Variable
3. SysAdmin Resizes Master
The SysAdmin resizes the master image, which is not saved at this time
4. SysAdmin Pulls Image Tiles
The SysAdmin pulls an array of URL's from a predefined source.
These are our Image Tiles.
5. SysAdmin Gets Average Color
The SysAdmin calculates the average color of each Image Tile
And assigns it to an array with the average as the key and the image as the value.
6. The SysAdmin Iterates Over The Master
The SysAdmin iterates over the master image replacing each pixel with the closest average matching Tile
7. The SysAdmin Saves the new Master
The SysAdmin saves the new master image
------------------------------
2. Feedback and Operation
------------------------------
Feedback and Operation will be to add genuine feedback to the script so that we can see what is happening as we go along. This process takes a considerable amount of time, so good user communication will be key.
8. SysAdmin starts the script
The SysAdmin starts the script and sees a Welcome Message
9. System gives feedback on the master image
When processing the Master Image, the system gives feedback and progress reports
10. System gives feedback on the source images
When processing the Source Images, the system gives feedback and progress reports
11. System gives feedback while creating and saving the Mosaic
When creating and saving the mosaic, the system gives feedback and progress reports
12. System runs the entire process from the command line start
When the SysAdmin enters the start command, a Mosaic is created
------------------------------
3. Error Checking
------------------------------
The two key areas where errors are prone to occur are when the image is downloaded, and when the best image is calculated. Error proof both of these areas and delete the guilty image from the Source Images queue.
13. Catching Bad Image Downloads
What happens when a Source Image download fails?
------------------------------
4. HSL Calculation
------------------------------
14. Generating the HSL Value for an Image
Creating the HSL value for an Image
------------------------------
5. Refactor 1
------------------------------
Redesign the way that image processing is handled by moving the master image into its own class. Then rebuild the pattern for the Source Images so that they are immediately resized to their thumbnail size after download, that way the color average calculations are operating on a much smaller image.
15. Download and Resize an image during initializiation
------------------------------
6. Data Storage
------------------------------
Store the Source Image information in a database and work out a better comparison algorithm using a database query to find the best color match. Try a Mongo database with MongoMapper as the first database try.
+++++++ EVERYTHING BELOW THIS LINE IS A BRAINSTORM WAITING TO BE IMPLEMENTED +++++++++++
------------------------------
SysAdmin & System Interaction
------------------------------
SysAdmin Starts Mosaic
The SysAdmin opens a shell, types a command and sees a welcome message and a prompt waiting for instruction
SysAdmin Assigns a Master
The SysAdmin assigns a value to the Master Class
System Resizes Master
The System resizes the Master Image according to the requirements
System Saves Master
The System saves the Master Image to the mosaic_store
SysAdmin Adds a Content Source
The SysAdmin inputs the command to add a new Content Source, which is stored in a flat file or other storage system
SysAdmin Pulls new Content
The SysAdmin inputs the command to pull new content
System Looks For New Content
The System goes through all Content Sources, looking for new content
System Finds New Content
The System pulls the image associated with the new content
System Saves the Image
The System saves the original version of the image into the mosaic_store
System Calculates the Average Color
The System collects all of the pixels from the image and calculates the Average Color
System Resizes the Image
The System creates a resized version of the image to use in the Mosaic
System Saves the Image
The System saves the resized version of the image
System Save Image Information
The System saves the image information into a flat file or other storage system
SysAdmin Orders new Mosaic
The SysAdmin inputs the command to build the new mosaic
The System reads the Master into an Array
The System reads the pixel colors into an Array
The System Compares to Content
The System finds the Content Item with the closest Average Color to the pixel
The System Compiles the new Image
The System rolls through the array and compiles the images into a new master
The System Saves the new Image
The System saves the new Image and records the most recent version
The System Saves the Array
The System saves the Array of pixels into store so that the tabled version can be rendered
SysAdmin Views Mosaic
The SysAdmin enters the command to view the new Mosaic
System Shows Mosaic
The System opens a browser and displays the saved Mosaic Image
SysAdmin Schedules System
The SysAdmin enters the command to schedule the System to refresh the Mosaic
------------------------------
Admin Interaction
------------------------------
Admin Starts Mosaic
The Admin starts Mosaic through the application
Admin Pulls new Content
The Admin clicks the link to pull new Content
The System goes through all Content Sources, looking for new content
System Processes new Content
The System processes the new content and stores the information in a flat file or other storage system
Admin Builds new Mosaic
The Admin clicks the link to rebuild the Mosaic
The System builds the Mosaic based on the existing Content and saves the output
Admin Views new Mosaic
The Admin clicks the link to view the Mosaic
The System displays the Mosaic in the current browser window
------------------------------
User Interaction
------------------------------
User Views Mosaic
The User clicks a link
The System displays the Mosaic in the current browser window
------------------------------
System Interaction
------------------------------
System Starts Mosaic on Schedule
The System starts Mosaic at the Scheduled time
System Pulls new Content
The System goes through all Content Sources, looking for new content
System Processes new Content
The System processes the new content and stores the information in a flat file or other storage system
System Builds new Mosaic
The System builds the Mosaic based on the existing Content and saves the output
------------------------------
Future Development
------------------------------
+ Use the MongoDB storage system to hold all of the data for the mosaic. Each Mosaic can be its own document
+ Use pubsubhubbub technology to receive new Content as it is published, then rebuild the Mosaic every hour