SlideShare une entreprise Scribd logo
1  sur  76
Mosaic Fun with
   OpenOffice Calc



  imacat (Yang Shih-Ching)
<imacat@mail.imacat.idv.tw>
          2012/11/6
“Mosaic Fun with OpenOffice Calc” is created by imacat (Yang Shih-Ching),
and licensed under a Creative Commons Attribution-ShareAlike 3.0 Unported License
imacat / Yang Shih-Ching
●   From Taiwan local OpenOffice community
●   A graduate student from the Computer
    Science Education Laboratory, National
    Taiwan Normal University
●   A member of Women in FOSS in Taiwan
●   Was…
    –   A Sun/Oracle freelance lecturer
    –   An OpenOffice RD for 1 year
    –   A web application developer for 8 years
This session is all about multimedia and fun.
        So please relax and enjoy!
After all, I’m not a show business professional.
                 I’m a developer.
Please forgive me if this is not cool enough. :p
Since this is all about multimedia,
          before we start,
lets get some multimedia first! ^_*’
Lets Gangnam Style!
Feeling spirited now? ^_^
I will start by telling a story…
Long time ago in the far, far land
   when I was still a child…
Long time ago in the far, far land
         when I was still a child…
Well, actually it was only in this August. :p
I saw on my RSS reader...
So I followed the story and
  watched the video…
It’s cool, isn’t it?
It’s cool, isn’t it?
Yes, it’s SO COOL!
I forwarded it onto our Google Plus,
      our Facebook fans page,
     our forums, local forum, etc.
I forwarded it onto our Google Plus,
      our Facebook fans page,
     our forums, local forum, etc.
          Then I put it away
      and return to my textbook.
Until I saw Rob talking about this
        video the next day…
So I watched it again, and also the
      “behind the scenes”…
Well, I think…
Well, I think…
Yeah, I can do it…
Well, I think…
Yeah, I can do it…
programmatically!
Creating mosaic art involves
calculating the average colors of image blocks.
Since neither OpenOffice BASIC nor UNO API
                has any method
    to obtain the colors of individual pixels,
           I have use Java to do this.
So here it is… ^_^
(demonstration)
It’s cool, isn’t it?
No.
No, that’s not cool.
It’s uglier than the original “Stop-Motion Excel”.
     It’s not the “eye candy” that I imagined.
Why?
     The original “Stop-Motion Excel”
     was painted manually, cell by cell.
MysteryGuitarMan painted it with a fixed
     palette, but not “average colors”.
It looks sharp. It feels like an animation.
Comparing Hand-Painted Colors
  with Mosaic Average Colors
So I need to find something more cool,
           something sharp,
    something with a high contrast.
That is not an easy task.
The idea of Calc Mosaic
     is not only to create mosaic arts,
but also to create stop-motion animations.
But it takes averagely 20 seconds
to create a spreadsheet of mosaic art
    with the Java UNO application.
      I cannot run the animation
by creating the mosaic art at real-time.
So I turn to another method,
to create each frame with a spreadsheet,
       and play them in sequence,
       as a stop-motion animation.
But then a spreadsheet document can only
 contain a maximum of 256 spreadsheets.
Since I only have 256 frames,
     this cannot be long.
I remembered there is the iPod Ad
The iPod Ad…
●   Has only 31 seconds, corresponding to 8
    FPS if we are having 256 frames.
The iPod Ad…
●   Has only 31 seconds, corresponding to 8
    FPS if we are having 256 frames.
●   Has sharp images, high contrasts.
The iPod Ad…
●   Has only 31 seconds, corresponding to 8
    FPS if we are having 256 frames.
●   Has sharp images, high contrasts.
●   Is very famous.
So here it is…
(demonstration)
At the same time, Villeroy responded to my
Calc Mosaic on the forum, using a different
                approach.
Villeroy’s Response
So here it is…
(demonstration)
As you can see,
 Villeroy places the color values in the cells.
 The OpenOffice BASIC macro can read and
update the cell background colors accordingly.
       OpenOffice BASIC is a lot faster
                than Java UNO.
This makes it possible to animate at real time.
Villeroy’s approach still has some
         disadvantages…
Disadvantages of
            Villeroy’s Approach
●   You still need to have the color values first.
Disadvantages of
             Villeroy’s Approach
●   You still need to have the color values first.
●   The frame rate is still low.
Disadvantages of
             Villeroy’s Approach
●   You still need to have the color values first.
●   The frame rate is still low.
●   Villeroy updates the colors with styles.
    –   A lot faster than painting the background
        color cell by cell.
    –   The number of colors to use is limited.
        That is why it is gray-scaled.
This is a different approach than me.
    But I still got greatly inspired.
The color values can be saved in the sheets,
   and painted with OpenOffice BASIC.
        This can make it a lot faster.
And I know there is the setDataArray()
     in the interface XCellRangeData.
I can populate all the color values at once
    instead of hundreds of UNO calls
    to set the CellBackColor property
                Of SheetCell.
The New Process Will Be…
1.Calculates the average colors of mosaic
  cells with the Java application.
The New Process Will Be…
1.Calculates the average colors of mosaic
  cells with the Java application.
2.Passes the color values from Java to
  OpenOffice BASIC.
The New Process Will Be…
1.Calculates the average colors of mosaic
  cells with the Java application.
2.Passes the color values from Java to
  OpenOffice BASIC.
3.Paints the background colors of the
  spreadsheet cells with the OpenOffice
  BASIC macro.
So the problem becomes:
        Writing an application
both in Java and OpenOffice BASIC.
So the problem becomes:
         Writing an application
 both in Java and OpenOffice BASIC.
               Or, simply,
Creating the OpenOffice BASIC macros
   through the UNO API with Java.
In the unpublished UNO API,
    there is a BasicLibraries property
            in OfficeDocument
     that application developers can
access, insert or delete the BASIC macros.
There’s also the XScriptProvider interface
        that I can use it to invoke
    the existing OpenOffice macros.
So I use them to “inject” the BASIC macros
into the newly-created spreadsheet document,
             and run these macros.
In fact, I don’t even need to use setDataArray()
to paste the color values into the spreadsheets.
   I can pass the color values as parameters
           to the invoked BASIC macros.
This is troublesome,
     but the result is amazing.
It is 8 times faster then before!
When I prepare for this presentation,
 I became more and more greedy.
I want something new,
        something hot,
something gets people excited!
Then I came across this…
Something hot…
Well, again, I think…
Well, again, I think…
 Yeah, I can do it!
The Gangnam Style song is 4:12 long.
            That is 252 seconds.
 With 10 FPS, it needs 2520 spreadsheets.
    That is 10 spreadsheet documents.
(Each has a maximum of 256 spreadsheets.)
I can then concatenate the 10 recorded videos,
              join them into one,
     and create an OpenOffice Calc Style.
So here is it. Enjoy!
Get Calc Mosaic!
http://sf.net/p/calcmosaic
Thank you.
Any questions?

Contenu connexe

En vedette

Wm moorhead practical steps in business continuity planning, shared strategies
Wm moorhead   practical steps in business continuity planning, shared strategiesWm moorhead   practical steps in business continuity planning, shared strategies
Wm moorhead practical steps in business continuity planning, shared strategiesBrandon Williams
 
Programmeren in alice[1]
Programmeren in alice[1]Programmeren in alice[1]
Programmeren in alice[1]Gilles Horemans
 
Trea1 joseluis garcía_azabarte
Trea1 joseluis garcía_azabarteTrea1 joseluis garcía_azabarte
Trea1 joseluis garcía_azabartejoseluisguitar
 
Lead Management in SugarCRM Series: Viewing Leads
Lead Management in SugarCRM Series: Viewing LeadsLead Management in SugarCRM Series: Viewing Leads
Lead Management in SugarCRM Series: Viewing LeadsAtcore Systems
 
Samir rafla principles of cardiology pages 62 86 --
Samir rafla principles of cardiology pages 62 86 --Samir rafla principles of cardiology pages 62 86 --
Samir rafla principles of cardiology pages 62 86 --Alexandria University, Egypt
 
OpenOffice, Open Business
OpenOffice, Open BusinessOpenOffice, Open Business
OpenOffice, Open Businessimacat .
 

En vedette (20)

Anja Enggaard - Call Me og tal ordentligt
Anja Enggaard - Call Me og tal ordentligtAnja Enggaard - Call Me og tal ordentligt
Anja Enggaard - Call Me og tal ordentligt
 
mads holst og mette svart kristiansen
mads holst og mette svart kristiansenmads holst og mette svart kristiansen
mads holst og mette svart kristiansen
 
Marianne Rasmussen
Marianne RasmussenMarianne Rasmussen
Marianne Rasmussen
 
Wm moorhead practical steps in business continuity planning, shared strategies
Wm moorhead   practical steps in business continuity planning, shared strategiesWm moorhead   practical steps in business continuity planning, shared strategies
Wm moorhead practical steps in business continuity planning, shared strategies
 
Programmeren in alice[1]
Programmeren in alice[1]Programmeren in alice[1]
Programmeren in alice[1]
 
Bodil Holstein - foto i stedet for intarsia
Bodil Holstein -  foto i stedet for intarsiaBodil Holstein -  foto i stedet for intarsia
Bodil Holstein - foto i stedet for intarsia
 
Henrik Sell - tilbage til istiden
Henrik Sell -  tilbage til istidenHenrik Sell -  tilbage til istiden
Henrik Sell - tilbage til istiden
 
Henriette Rensbo, Nationalmuseet, Årets kirkearkæologiske undersøgelser 2012
Henriette Rensbo, Nationalmuseet, Årets kirkearkæologiske undersøgelser 2012Henriette Rensbo, Nationalmuseet, Årets kirkearkæologiske undersøgelser 2012
Henriette Rensbo, Nationalmuseet, Årets kirkearkæologiske undersøgelser 2012
 
Trea1 joseluis garcía_azabarte
Trea1 joseluis garcía_azabarteTrea1 joseluis garcía_azabarte
Trea1 joseluis garcía_azabarte
 
2 recovery guidelines
2 recovery guidelines2 recovery guidelines
2 recovery guidelines
 
Lise Harvig
Lise HarvigLise Harvig
Lise Harvig
 
Lead Management in SugarCRM Series: Viewing Leads
Lead Management in SugarCRM Series: Viewing LeadsLead Management in SugarCRM Series: Viewing Leads
Lead Management in SugarCRM Series: Viewing Leads
 
Palle Eriksen hulbælter
Palle Eriksen hulbælterPalle Eriksen hulbælter
Palle Eriksen hulbælter
 
linda boye
linda boyelinda boye
linda boye
 
Linda Mol - Planning involving visitors
Linda Mol -  Planning involving visitorsLinda Mol -  Planning involving visitors
Linda Mol - Planning involving visitors
 
Esben Kjeldbæk, Lad genstanden tale. Erfaringer og overvejelser fra Nationalm...
Esben Kjeldbæk, Lad genstanden tale. Erfaringer og overvejelser fra Nationalm...Esben Kjeldbæk, Lad genstanden tale. Erfaringer og overvejelser fra Nationalm...
Esben Kjeldbæk, Lad genstanden tale. Erfaringer og overvejelser fra Nationalm...
 
Lennart S. Madsen, De fem søjler og arkæologien version 3
Lennart S. Madsen, De fem søjler og arkæologien version 3Lennart S. Madsen, De fem søjler og arkæologien version 3
Lennart S. Madsen, De fem søjler og arkæologien version 3
 
Svend Illum Hansen
Svend Illum HansenSvend Illum Hansen
Svend Illum Hansen
 
Samir rafla principles of cardiology pages 62 86 --
Samir rafla principles of cardiology pages 62 86 --Samir rafla principles of cardiology pages 62 86 --
Samir rafla principles of cardiology pages 62 86 --
 
OpenOffice, Open Business
OpenOffice, Open BusinessOpenOffice, Open Business
OpenOffice, Open Business
 

Similaire à Create Mosaic Art with OpenOffice Calc

Javascript Animation with Canvas - Gregory Starr 2015
Javascript Animation with Canvas - Gregory Starr 2015Javascript Animation with Canvas - Gregory Starr 2015
Javascript Animation with Canvas - Gregory Starr 2015Gregory Starr
 
Smalltalk in the pocket - Building applications for the iPhone
Smalltalk in the pocket - Building applications for the iPhoneSmalltalk in the pocket - Building applications for the iPhone
Smalltalk in the pocket - Building applications for the iPhoneEsteban Lorenzano
 
WRA 210 April 14th PowerPoint
WRA 210 April 14th PowerPointWRA 210 April 14th PowerPoint
WRA 210 April 14th PowerPointMiami University
 
Transcript - Data Visualisation - Tools and Techniques
Transcript - Data Visualisation - Tools and TechniquesTranscript - Data Visualisation - Tools and Techniques
Transcript - Data Visualisation - Tools and TechniquesARDC
 
Adobe Illustrator - Creating the Poster
Adobe Illustrator - Creating the PosterAdobe Illustrator - Creating the Poster
Adobe Illustrator - Creating the PosterTimothy F McKenna
 
What does OOP stand for?
What does OOP stand for?What does OOP stand for?
What does OOP stand for?Colin Riley
 
Coding - Pixel Art
Coding - Pixel ArtCoding - Pixel Art
Coding - Pixel Artisarevi
 
Visual Rhetoric, Feb 18, 2013
Visual Rhetoric, Feb 18, 2013Visual Rhetoric, Feb 18, 2013
Visual Rhetoric, Feb 18, 2013Miami University
 
Monday Night, Feb 10th Visrhet
Monday Night, Feb 10th VisrhetMonday Night, Feb 10th Visrhet
Monday Night, Feb 10th VisrhetMiami University
 
16 OpenCV Functions to Start your Computer Vision journey.docx
16 OpenCV Functions to Start your Computer Vision journey.docx16 OpenCV Functions to Start your Computer Vision journey.docx
16 OpenCV Functions to Start your Computer Vision journey.docxssuser90e017
 
Umbra Ignite 2015: Alex Evans – Learning from failure – prototypes, R&D, iter...
Umbra Ignite 2015: Alex Evans – Learning from failure – prototypes, R&D, iter...Umbra Ignite 2015: Alex Evans – Learning from failure – prototypes, R&D, iter...
Umbra Ignite 2015: Alex Evans – Learning from failure – prototypes, R&D, iter...Umbra Software
 
3. fmp production experiments (finished)
3. fmp production experiments (finished)3. fmp production experiments (finished)
3. fmp production experiments (finished)sean cawood
 
Scilab for real dummies j.heikell - part 1
Scilab for real dummies j.heikell - part 1Scilab for real dummies j.heikell - part 1
Scilab for real dummies j.heikell - part 1Scilab
 

Similaire à Create Mosaic Art with OpenOffice Calc (20)

Javascript Animation with Canvas - Gregory Starr 2015
Javascript Animation with Canvas - Gregory Starr 2015Javascript Animation with Canvas - Gregory Starr 2015
Javascript Animation with Canvas - Gregory Starr 2015
 
Smalltalk in the pocket - Building applications for the iPhone
Smalltalk in the pocket - Building applications for the iPhoneSmalltalk in the pocket - Building applications for the iPhone
Smalltalk in the pocket - Building applications for the iPhone
 
Framing the canvas - DroidCon Paris 2014
Framing the canvas - DroidCon Paris 2014Framing the canvas - DroidCon Paris 2014
Framing the canvas - DroidCon Paris 2014
 
WRA 210 April 14th PowerPoint
WRA 210 April 14th PowerPointWRA 210 April 14th PowerPoint
WRA 210 April 14th PowerPoint
 
Frost
FrostFrost
Frost
 
Transcript - Data Visualisation - Tools and Techniques
Transcript - Data Visualisation - Tools and TechniquesTranscript - Data Visualisation - Tools and Techniques
Transcript - Data Visualisation - Tools and Techniques
 
Adobe Illustrator - Creating the Poster
Adobe Illustrator - Creating the PosterAdobe Illustrator - Creating the Poster
Adobe Illustrator - Creating the Poster
 
What does OOP stand for?
What does OOP stand for?What does OOP stand for?
What does OOP stand for?
 
Coding - Pixel Art
Coding - Pixel ArtCoding - Pixel Art
Coding - Pixel Art
 
Visual Rhetoric, Feb 18, 2013
Visual Rhetoric, Feb 18, 2013Visual Rhetoric, Feb 18, 2013
Visual Rhetoric, Feb 18, 2013
 
Monday Night, Feb 10th Visrhet
Monday Night, Feb 10th VisrhetMonday Night, Feb 10th Visrhet
Monday Night, Feb 10th Visrhet
 
Problem solving
Problem solvingProblem solving
Problem solving
 
16 OpenCV Functions to Start your Computer Vision journey.docx
16 OpenCV Functions to Start your Computer Vision journey.docx16 OpenCV Functions to Start your Computer Vision journey.docx
16 OpenCV Functions to Start your Computer Vision journey.docx
 
Umbra Ignite 2015: Alex Evans – Learning from failure – prototypes, R&D, iter...
Umbra Ignite 2015: Alex Evans – Learning from failure – prototypes, R&D, iter...Umbra Ignite 2015: Alex Evans – Learning from failure – prototypes, R&D, iter...
Umbra Ignite 2015: Alex Evans – Learning from failure – prototypes, R&D, iter...
 
20140830 maker fairetrondheim
20140830 maker fairetrondheim20140830 maker fairetrondheim
20140830 maker fairetrondheim
 
3. fmp production experiments (finished)
3. fmp production experiments (finished)3. fmp production experiments (finished)
3. fmp production experiments (finished)
 
January 29th PowerPoint
January 29th PowerPointJanuary 29th PowerPoint
January 29th PowerPoint
 
"Prototype Everything" at The conference(19/Aug/2014,Malmo,Sweden) by @tks
"Prototype Everything"  at The conference(19/Aug/2014,Malmo,Sweden)  by @tks"Prototype Everything"  at The conference(19/Aug/2014,Malmo,Sweden)  by @tks
"Prototype Everything" at The conference(19/Aug/2014,Malmo,Sweden) by @tks
 
Tensorflow go
Tensorflow goTensorflow go
Tensorflow go
 
Scilab for real dummies j.heikell - part 1
Scilab for real dummies j.heikell - part 1Scilab for real dummies j.heikell - part 1
Scilab for real dummies j.heikell - part 1
 

Plus de imacat .

A Room of WikiWomen's Own
A Room of WikiWomen's OwnA Room of WikiWomen's Own
A Room of WikiWomen's Ownimacat .
 
Office寶可夢GO IV計算機
Office寶可夢GO IV計算機Office寶可夢GO IV計算機
Office寶可夢GO IV計算機imacat .
 
Crossing Office Applications
Crossing Office ApplicationsCrossing Office Applications
Crossing Office Applicationsimacat .
 
OpenOffice Application with Python
OpenOffice Application with PythonOpenOffice Application with Python
OpenOffice Application with Pythonimacat .
 
從doc、docx、odt到Google Docs
從doc、docx、odt到Google Docs從doc、docx、odt到Google Docs
從doc、docx、odt到Google Docsimacat .
 
More Girls – Creating a Community of Diversity
More Girls – Creating a Community of DiversityMore Girls – Creating a Community of Diversity
More Girls – Creating a Community of Diversityimacat .
 
Welcome to Apache OpenOffice 4
Welcome to Apache OpenOffice 4Welcome to Apache OpenOffice 4
Welcome to Apache OpenOffice 4imacat .
 
Welcome to Apache OpenOffice 3.4 COSCUP 2012
Welcome to Apache OpenOffice 3.4 COSCUP 2012Welcome to Apache OpenOffice 3.4 COSCUP 2012
Welcome to Apache OpenOffice 3.4 COSCUP 2012imacat .
 
GNU Autoconf / Automake #4
GNU Autoconf / Automake #4GNU Autoconf / Automake #4
GNU Autoconf / Automake #4imacat .
 
GNU Autoconf / Automake #1
GNU Autoconf / Automake #1GNU Autoconf / Automake #1
GNU Autoconf / Automake #1imacat .
 
Solitaire with Greenfoot #3
Solitaire with Greenfoot #3Solitaire with Greenfoot #3
Solitaire with Greenfoot #3imacat .
 
Solitaire with Greenfoot #1
Solitaire with Greenfoot #1Solitaire with Greenfoot #1
Solitaire with Greenfoot #1imacat .
 
Solitaire with Greenfoot #4
Solitaire with Greenfoot #4Solitaire with Greenfoot #4
Solitaire with Greenfoot #4imacat .
 
Solitaire with Greenfoot #2
Solitaire with Greenfoot #2Solitaire with Greenfoot #2
Solitaire with Greenfoot #2imacat .
 
Solitaire with Greenfoot #2/4
Solitaire with Greenfoot #2/4Solitaire with Greenfoot #2/4
Solitaire with Greenfoot #2/4imacat .
 
Object-Oriented Programming Design with Greenfoot 02
Object-Oriented Programming Design with Greenfoot 02Object-Oriented Programming Design with Greenfoot 02
Object-Oriented Programming Design with Greenfoot 02imacat .
 
Object-Oriented Programming Design with Greenfoot 01
Object-Oriented Programming Design with Greenfoot 01Object-Oriented Programming Design with Greenfoot 01
Object-Oriented Programming Design with Greenfoot 01imacat .
 
Welcome to Apache OpenOffice 3.4
Welcome to Apache OpenOffice 3.4Welcome to Apache OpenOffice 3.4
Welcome to Apache OpenOffice 3.4imacat .
 
OpenOffice UNO Application on Android
OpenOffice UNO Application on AndroidOpenOffice UNO Application on Android
OpenOffice UNO Application on Androidimacat .
 
OpenOffice.org Magic Sandbox
OpenOffice.org Magic SandboxOpenOffice.org Magic Sandbox
OpenOffice.org Magic Sandboximacat .
 

Plus de imacat . (20)

A Room of WikiWomen's Own
A Room of WikiWomen's OwnA Room of WikiWomen's Own
A Room of WikiWomen's Own
 
Office寶可夢GO IV計算機
Office寶可夢GO IV計算機Office寶可夢GO IV計算機
Office寶可夢GO IV計算機
 
Crossing Office Applications
Crossing Office ApplicationsCrossing Office Applications
Crossing Office Applications
 
OpenOffice Application with Python
OpenOffice Application with PythonOpenOffice Application with Python
OpenOffice Application with Python
 
從doc、docx、odt到Google Docs
從doc、docx、odt到Google Docs從doc、docx、odt到Google Docs
從doc、docx、odt到Google Docs
 
More Girls – Creating a Community of Diversity
More Girls – Creating a Community of DiversityMore Girls – Creating a Community of Diversity
More Girls – Creating a Community of Diversity
 
Welcome to Apache OpenOffice 4
Welcome to Apache OpenOffice 4Welcome to Apache OpenOffice 4
Welcome to Apache OpenOffice 4
 
Welcome to Apache OpenOffice 3.4 COSCUP 2012
Welcome to Apache OpenOffice 3.4 COSCUP 2012Welcome to Apache OpenOffice 3.4 COSCUP 2012
Welcome to Apache OpenOffice 3.4 COSCUP 2012
 
GNU Autoconf / Automake #4
GNU Autoconf / Automake #4GNU Autoconf / Automake #4
GNU Autoconf / Automake #4
 
GNU Autoconf / Automake #1
GNU Autoconf / Automake #1GNU Autoconf / Automake #1
GNU Autoconf / Automake #1
 
Solitaire with Greenfoot #3
Solitaire with Greenfoot #3Solitaire with Greenfoot #3
Solitaire with Greenfoot #3
 
Solitaire with Greenfoot #1
Solitaire with Greenfoot #1Solitaire with Greenfoot #1
Solitaire with Greenfoot #1
 
Solitaire with Greenfoot #4
Solitaire with Greenfoot #4Solitaire with Greenfoot #4
Solitaire with Greenfoot #4
 
Solitaire with Greenfoot #2
Solitaire with Greenfoot #2Solitaire with Greenfoot #2
Solitaire with Greenfoot #2
 
Solitaire with Greenfoot #2/4
Solitaire with Greenfoot #2/4Solitaire with Greenfoot #2/4
Solitaire with Greenfoot #2/4
 
Object-Oriented Programming Design with Greenfoot 02
Object-Oriented Programming Design with Greenfoot 02Object-Oriented Programming Design with Greenfoot 02
Object-Oriented Programming Design with Greenfoot 02
 
Object-Oriented Programming Design with Greenfoot 01
Object-Oriented Programming Design with Greenfoot 01Object-Oriented Programming Design with Greenfoot 01
Object-Oriented Programming Design with Greenfoot 01
 
Welcome to Apache OpenOffice 3.4
Welcome to Apache OpenOffice 3.4Welcome to Apache OpenOffice 3.4
Welcome to Apache OpenOffice 3.4
 
OpenOffice UNO Application on Android
OpenOffice UNO Application on AndroidOpenOffice UNO Application on Android
OpenOffice UNO Application on Android
 
OpenOffice.org Magic Sandbox
OpenOffice.org Magic SandboxOpenOffice.org Magic Sandbox
OpenOffice.org Magic Sandbox
 

Dernier

A Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software DevelopersA Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software DevelopersNicole Novielli
 
Moving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdfMoving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdfLoriGlavin3
 
Rise of the Machines: Known As Drones...
Rise of the Machines: Known As Drones...Rise of the Machines: Known As Drones...
Rise of the Machines: Known As Drones...Rick Flair
 
Generative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information DevelopersGenerative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information DevelopersRaghuram Pandurangan
 
UiPath Community: Communication Mining from Zero to Hero
UiPath Community: Communication Mining from Zero to HeroUiPath Community: Communication Mining from Zero to Hero
UiPath Community: Communication Mining from Zero to HeroUiPathCommunity
 
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024BookNet Canada
 
The Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsThe Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsPixlogix Infotech
 
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptxPasskey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptxLoriGlavin3
 
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptxThe Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptxLoriGlavin3
 
Manual 508 Accessibility Compliance Audit
Manual 508 Accessibility Compliance AuditManual 508 Accessibility Compliance Audit
Manual 508 Accessibility Compliance AuditSkynet Technologies
 
Why device, WIFI, and ISP insights are crucial to supporting remote Microsoft...
Why device, WIFI, and ISP insights are crucial to supporting remote Microsoft...Why device, WIFI, and ISP insights are crucial to supporting remote Microsoft...
Why device, WIFI, and ISP insights are crucial to supporting remote Microsoft...panagenda
 
[Webinar] SpiraTest - Setting New Standards in Quality Assurance
[Webinar] SpiraTest - Setting New Standards in Quality Assurance[Webinar] SpiraTest - Setting New Standards in Quality Assurance
[Webinar] SpiraTest - Setting New Standards in Quality AssuranceInflectra
 
A Framework for Development in the AI Age
A Framework for Development in the AI AgeA Framework for Development in the AI Age
A Framework for Development in the AI AgeCprime
 
Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...
Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...
Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...Alkin Tezuysal
 
Long journey of Ruby standard library at RubyConf AU 2024
Long journey of Ruby standard library at RubyConf AU 2024Long journey of Ruby standard library at RubyConf AU 2024
Long journey of Ruby standard library at RubyConf AU 2024Hiroshi SHIBATA
 
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc
 
Modern Roaming for Notes and Nomad – Cheaper Faster Better Stronger
Modern Roaming for Notes and Nomad – Cheaper Faster Better StrongerModern Roaming for Notes and Nomad – Cheaper Faster Better Stronger
Modern Roaming for Notes and Nomad – Cheaper Faster Better Strongerpanagenda
 
The State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptxThe State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptxLoriGlavin3
 
Sample pptx for embedding into website for demo
Sample pptx for embedding into website for demoSample pptx for embedding into website for demo
Sample pptx for embedding into website for demoHarshalMandlekar2
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsSergiu Bodiu
 

Dernier (20)

A Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software DevelopersA Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software Developers
 
Moving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdfMoving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdf
 
Rise of the Machines: Known As Drones...
Rise of the Machines: Known As Drones...Rise of the Machines: Known As Drones...
Rise of the Machines: Known As Drones...
 
Generative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information DevelopersGenerative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information Developers
 
UiPath Community: Communication Mining from Zero to Hero
UiPath Community: Communication Mining from Zero to HeroUiPath Community: Communication Mining from Zero to Hero
UiPath Community: Communication Mining from Zero to Hero
 
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
 
The Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsThe Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and Cons
 
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptxPasskey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptx
 
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptxThe Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
 
Manual 508 Accessibility Compliance Audit
Manual 508 Accessibility Compliance AuditManual 508 Accessibility Compliance Audit
Manual 508 Accessibility Compliance Audit
 
Why device, WIFI, and ISP insights are crucial to supporting remote Microsoft...
Why device, WIFI, and ISP insights are crucial to supporting remote Microsoft...Why device, WIFI, and ISP insights are crucial to supporting remote Microsoft...
Why device, WIFI, and ISP insights are crucial to supporting remote Microsoft...
 
[Webinar] SpiraTest - Setting New Standards in Quality Assurance
[Webinar] SpiraTest - Setting New Standards in Quality Assurance[Webinar] SpiraTest - Setting New Standards in Quality Assurance
[Webinar] SpiraTest - Setting New Standards in Quality Assurance
 
A Framework for Development in the AI Age
A Framework for Development in the AI AgeA Framework for Development in the AI Age
A Framework for Development in the AI Age
 
Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...
Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...
Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...
 
Long journey of Ruby standard library at RubyConf AU 2024
Long journey of Ruby standard library at RubyConf AU 2024Long journey of Ruby standard library at RubyConf AU 2024
Long journey of Ruby standard library at RubyConf AU 2024
 
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
 
Modern Roaming for Notes and Nomad – Cheaper Faster Better Stronger
Modern Roaming for Notes and Nomad – Cheaper Faster Better StrongerModern Roaming for Notes and Nomad – Cheaper Faster Better Stronger
Modern Roaming for Notes and Nomad – Cheaper Faster Better Stronger
 
The State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptxThe State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptx
 
Sample pptx for embedding into website for demo
Sample pptx for embedding into website for demoSample pptx for embedding into website for demo
Sample pptx for embedding into website for demo
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platforms
 

Create Mosaic Art with OpenOffice Calc

  • 1. Mosaic Fun with OpenOffice Calc imacat (Yang Shih-Ching) <imacat@mail.imacat.idv.tw> 2012/11/6
  • 2. “Mosaic Fun with OpenOffice Calc” is created by imacat (Yang Shih-Ching), and licensed under a Creative Commons Attribution-ShareAlike 3.0 Unported License
  • 3. imacat / Yang Shih-Ching ● From Taiwan local OpenOffice community ● A graduate student from the Computer Science Education Laboratory, National Taiwan Normal University ● A member of Women in FOSS in Taiwan ● Was… – A Sun/Oracle freelance lecturer – An OpenOffice RD for 1 year – A web application developer for 8 years
  • 4. This session is all about multimedia and fun. So please relax and enjoy!
  • 5. After all, I’m not a show business professional. I’m a developer. Please forgive me if this is not cool enough. :p
  • 6. Since this is all about multimedia, before we start, lets get some multimedia first! ^_*’
  • 9. I will start by telling a story…
  • 10. Long time ago in the far, far land when I was still a child…
  • 11. Long time ago in the far, far land when I was still a child… Well, actually it was only in this August. :p
  • 12. I saw on my RSS reader...
  • 13. So I followed the story and watched the video…
  • 15. It’s cool, isn’t it? Yes, it’s SO COOL!
  • 16. I forwarded it onto our Google Plus, our Facebook fans page, our forums, local forum, etc.
  • 17. I forwarded it onto our Google Plus, our Facebook fans page, our forums, local forum, etc. Then I put it away and return to my textbook.
  • 18. Until I saw Rob talking about this video the next day…
  • 19. So I watched it again, and also the “behind the scenes”…
  • 21. Well, I think… Yeah, I can do it…
  • 22. Well, I think… Yeah, I can do it… programmatically!
  • 23. Creating mosaic art involves calculating the average colors of image blocks. Since neither OpenOffice BASIC nor UNO API has any method to obtain the colors of individual pixels, I have use Java to do this.
  • 24. So here it is… ^_^
  • 27. No.
  • 28. No, that’s not cool. It’s uglier than the original “Stop-Motion Excel”. It’s not the “eye candy” that I imagined.
  • 29. Why? The original “Stop-Motion Excel” was painted manually, cell by cell. MysteryGuitarMan painted it with a fixed palette, but not “average colors”. It looks sharp. It feels like an animation.
  • 30. Comparing Hand-Painted Colors with Mosaic Average Colors
  • 31. So I need to find something more cool, something sharp, something with a high contrast.
  • 32. That is not an easy task.
  • 33. The idea of Calc Mosaic is not only to create mosaic arts, but also to create stop-motion animations.
  • 34. But it takes averagely 20 seconds to create a spreadsheet of mosaic art with the Java UNO application. I cannot run the animation by creating the mosaic art at real-time.
  • 35. So I turn to another method, to create each frame with a spreadsheet, and play them in sequence, as a stop-motion animation.
  • 36. But then a spreadsheet document can only contain a maximum of 256 spreadsheets.
  • 37. Since I only have 256 frames, this cannot be long.
  • 38. I remembered there is the iPod Ad
  • 39. The iPod Ad… ● Has only 31 seconds, corresponding to 8 FPS if we are having 256 frames.
  • 40. The iPod Ad… ● Has only 31 seconds, corresponding to 8 FPS if we are having 256 frames. ● Has sharp images, high contrasts.
  • 41. The iPod Ad… ● Has only 31 seconds, corresponding to 8 FPS if we are having 256 frames. ● Has sharp images, high contrasts. ● Is very famous.
  • 42. So here it is…
  • 44. At the same time, Villeroy responded to my Calc Mosaic on the forum, using a different approach.
  • 46. So here it is…
  • 48. As you can see, Villeroy places the color values in the cells. The OpenOffice BASIC macro can read and update the cell background colors accordingly. OpenOffice BASIC is a lot faster than Java UNO. This makes it possible to animate at real time.
  • 49. Villeroy’s approach still has some disadvantages…
  • 50. Disadvantages of Villeroy’s Approach ● You still need to have the color values first.
  • 51. Disadvantages of Villeroy’s Approach ● You still need to have the color values first. ● The frame rate is still low.
  • 52. Disadvantages of Villeroy’s Approach ● You still need to have the color values first. ● The frame rate is still low. ● Villeroy updates the colors with styles. – A lot faster than painting the background color cell by cell. – The number of colors to use is limited. That is why it is gray-scaled.
  • 53. This is a different approach than me. But I still got greatly inspired.
  • 54. The color values can be saved in the sheets, and painted with OpenOffice BASIC. This can make it a lot faster.
  • 55. And I know there is the setDataArray() in the interface XCellRangeData. I can populate all the color values at once instead of hundreds of UNO calls to set the CellBackColor property Of SheetCell.
  • 56. The New Process Will Be… 1.Calculates the average colors of mosaic cells with the Java application.
  • 57. The New Process Will Be… 1.Calculates the average colors of mosaic cells with the Java application. 2.Passes the color values from Java to OpenOffice BASIC.
  • 58. The New Process Will Be… 1.Calculates the average colors of mosaic cells with the Java application. 2.Passes the color values from Java to OpenOffice BASIC. 3.Paints the background colors of the spreadsheet cells with the OpenOffice BASIC macro.
  • 59. So the problem becomes: Writing an application both in Java and OpenOffice BASIC.
  • 60. So the problem becomes: Writing an application both in Java and OpenOffice BASIC. Or, simply, Creating the OpenOffice BASIC macros through the UNO API with Java.
  • 61. In the unpublished UNO API, there is a BasicLibraries property in OfficeDocument that application developers can access, insert or delete the BASIC macros.
  • 62. There’s also the XScriptProvider interface that I can use it to invoke the existing OpenOffice macros.
  • 63. So I use them to “inject” the BASIC macros into the newly-created spreadsheet document, and run these macros.
  • 64. In fact, I don’t even need to use setDataArray() to paste the color values into the spreadsheets. I can pass the color values as parameters to the invoked BASIC macros.
  • 65. This is troublesome, but the result is amazing. It is 8 times faster then before!
  • 66. When I prepare for this presentation, I became more and more greedy.
  • 67. I want something new, something hot, something gets people excited!
  • 68. Then I came across this…
  • 70. Well, again, I think…
  • 71. Well, again, I think… Yeah, I can do it!
  • 72. The Gangnam Style song is 4:12 long. That is 252 seconds. With 10 FPS, it needs 2520 spreadsheets. That is 10 spreadsheet documents. (Each has a maximum of 256 spreadsheets.)
  • 73. I can then concatenate the 10 recorded videos, join them into one, and create an OpenOffice Calc Style.
  • 74. So here is it. Enjoy!