cssAudio - Activefile-genericCSS - ActiveGeneric - ActiveHTML - ActiveImage - ActiveJS - ActiveSVG - ActiveText - Activefile-genericVideo - ActiveLovehtmlicon-new-collectionicon-personicon-teamlog-outoctocatpop-outspinnerstartv

Pen Settings

CSS Base

Vendor Prefixing

Add External Stylesheets/Pens

Any URL's added here will be added as <link>s in order, and before the CSS in the editor. If you link to another Pen, it will include the CSS from that Pen. If the preprocessor matches, it will attempt to combine them before processing.

Quick-add: + add another resource

Add External Scripts/Pens

Any URL's added here will be added as <script>s in order, and run before the JavaScript in the editor. You can use the URL of any other Pen and it will include the JavaScript from that Pen.

Quick-add: + add another resource

Code Indentation

     

Save Automatically?

If active, Pens will autosave every 30 seconds after being saved once.

Auto-Updating Preview

If enabled, the preview panel updates automatically as you code. If disabled, use the "Run" button to update.

            
              <head>
          
    </header>

  
<header><center>
        <div class="text-vcenter"><h1>Glaser's Images, Eggs and Intrigues</div>
    </header>


  
</head>
 
<body><center>
  
  <p><h3>
  
  
  <table border ="5" CellPadding ="10"  CellSpacing ="20"
    <tr><center> 
      <td><center><font color="purple"
<em>Glaser Electronic Portfolio<br>Part 2:Code<br>for<br><a name = "Original"> Image & Modified Image</a>    
  <h4></center><center>First Photo of Easter Eggs in Gray Scale<br>
gray scale
var egg = new SimpleImage("eastereggs.jpg");<br>
for (var p of egg.values()) {
    var avg = (p.getGreen() + p.getRed() + p.getBlue()) / 3;<br>
    p.setRed(avg);<br>
    p.setBlue(avg);<br>
    p.setGreen(avg);<br>
}
print(egg);<br>

<img src="https://s3-us-west-2.amazonaws.com/s.cdpn.io/496283/myImage(3).png" width="25%" /><br><br><img src= "https://s3-us-west-2.amazonaws.com/s.cdpn.io/496283/myImage(5).png" width="50%" /><br>
Converting from Grey Scale to MANY PHOTOS of Colorful Easter Eggs<br>
var image = new SimpleImage("eastereggs.jpg");<br>
w = image.getWidth();<br>
h = image.getHeight();<br>
var outimage= new SimpleImage(2*w,2*h);<br>
for (var pixel of outimage.values()){
 x = pixel.getX();<br>
 y = pixel.getY();<br>
 if (x<=w-1 && y<=h-1){
 var p = image.getPixel(x,y);<br>
 }
 else if (x>w-1 && y<=h-1) {
 var p = image.getPixel((x-w),y);<br>
 }
 else if (x<=w-1){
 var p = image.getPixel(x,(y-h));<br>
 }
 else var p = image.getPixel((x-w),(y-h));
 pixel.setRed(p.getRed());<br>
 pixel.setGreen(p.getGreen());<br>
 pixel.setBlue(p.getBlue());<br>
}
print(outimage);<br>
var image = new SimpleImage("rodger.png");<br>
w = image.getWidth();<br>
h = image.getHeight();<br>
var outimage= new SimpleImage(2*w,2*h);<br>
for (var pixel of outimage.values()){
 x = pixel.getX();<br>
 y = pixel.getY();<br>
 if (x<=w-1 && y<=h-1){
 var p = image.getPixel(x,y);<br>
 }
 else if (x>w-1 && y<=h-1) {
 var p = image.getPixel((x-w),y);<br>
 }
 else if (x<=w-1){
 var p = image.getPixel(x,(y-h));<br>
 }
 else var p = image.getPixel((x-w),(y-h));<br>
 pixel.setRed(p.getRed());<br>
 pixel.setGreen(p.getGreen());<br>
 pixel.setBlue(p.getBlue());<br>
}
print(outimage);
     
            
          
!
            
              @import url(https://fonts.googleapis.com/css?family=Righteous|Roboto);
h1 {text-align: center; background-color: #cc99ff;}
table border {background-color: black;}
ul {list-style-type:none;}
p {
    background-color: #ff6600;
}
tr {
    background: #99ff99;
}  
h6 {background-color: lightyellow;}
ul{background-color: lightyellow;}

div {
    width: 500px;
    height: 100px;
    border: 3px solid #73AD21;
}
div {
    width: 500px;
    height: 50px;
    border: 3px solid #73AD21;
}



            
          
!
999px
Loading ..................

Console