Jump to content

Javascript Histogram Problem!


smonkcaptain

Recommended Posts

Hey all,

 

I've been trying to use this Pixastic Image histogram tonight but to no avail!

http://www.pixastic.com/lib/docs/actions/histogram/

 

I have followed all the instructions, however when i load the page nothing appears.

I do have the 'test.jpg' in the same folder as the JS files too.

 

Here is my code:

 

<script type="text/javascript" src="pixastic.custom.js"></script>
<script type="text/javascript" src="histogram.js"></script>
<script type="text/javascript">
var hist = {};
var img = new Image();
img.onload = function() {
Pixastic.process(img, "histogram", {
	average:false,paint:true,color:"rgb(255,0,0)",returnValue:{}
});
}
document.body.appendChild(img);
img.src = "test.jpg";

// code used in the demo:
var hist = {};
function demo() {
Pixastic.process(document.getElementById("demoimage"), "histogram", {
	average : false, paint:true,color:"rgba(255,255,255,0.5)",returnValue:hist
});
$("#text-histogram").val(hist.values);
}

</script>


 

If you wish to source the external .js files they are:

 

http://www.aviation-photographs.net/screeners/histogram.js

http://www.aviation-photographs.net/screeners/pixastic.custom.js

 

However they are not touched.

 

Thanks in advanced, Jimmy Leaman...

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.