Forum     

Go Back   Digit Technology Discussion Forum > Software > Programming
Register FAQ Calendar Mark Forums Read

Programming The destination for developers - C, C++, Java, Python and the lot


Closed Thread
 
LinkBack Thread Tools Display Modes
Old 25-02-2008, 07:50 PM   #1 (permalink)
The Frozen Nova
 
casanova's Avatar
 
Join Date: Sep 2004
Location: Trespasser in Virtual Land
Posts: 1,641
Lightbulb Javascript wanted


I need a javascript that can determine the most frequently occuring color in an image and set the windows background color to the most frequently occuring color.

Java scripters, any1 here.
__________________
I dream of a better tomorrow... where chickens can cross roads and not have their motives questioned.

www.nerdweed.blogspot.com
casanova is offline  
Advertisements. Register and be a member of the community to get rid of them.
Advertisement

Old 25-02-2008, 07:54 PM   #2 (permalink)
हॉर्न ओके प्लीज़
 
victor_rambo's Avatar
 
Join Date: Sep 2007
Posts: 1,493
Default Re: Javascript wanted

Not possible using javascript AFAIK!
__________________
विक्टर रॅंबो - चाणकया प्रभावित व्यक्ति

गीक होना माँगता
victor_rambo is offline  
Old 25-02-2008, 08:29 PM   #3 (permalink)
Commander in Chief
 
QwertyManiac's Avatar
 
Join Date: Jul 2005
Posts: 6,658
Default Re: Javascript wanted

You want it in Java or JavaScript?
__________________
Harsh J
www.harshj.com
QwertyManiac is offline  
Old 25-02-2008, 08:37 PM   #4 (permalink)
Wahahaha~!
 
Faun's Avatar
 
Join Date: Dec 2006
Location: Pune/there
Posts: 7,675
Default Re: Javascript wanted

possible in java using image processing class
search a bit
__________________
Blog | Flickr | Battlelog
Spoiler:
Asus Z68 V-Pro|i5 2500k|TRUE Black|Ripjaws X|U2311H|N560GTX|D7000|XONAR STX|RE272|RE0|CC51|XE200PRO Walnut| TD II V2| Ultraphile|N5800

Mono
Faun is online now  
Old 25-02-2008, 08:48 PM   #5 (permalink)
The Frozen Nova
 
casanova's Avatar
 
Join Date: Sep 2004
Location: Trespasser in Virtual Land
Posts: 1,641
Default Re: Javascript wanted

Want it in Javascript. Couldn't find one.

Might be something else that can do that will work as long as I can find a way to call it through a javascript.
__________________
I dream of a better tomorrow... where chickens can cross roads and not have their motives questioned.

www.nerdweed.blogspot.com
casanova is offline  
Old 25-02-2008, 08:56 PM   #6 (permalink)
Commander in Chief
 
QwertyManiac's Avatar
 
Join Date: Jul 2005
Posts: 6,658
Default Re: Javascript wanted

JavaScript is client-side scripting, you wont be able to do it even then unless you make the user run some particular thing which returns to your script.

And no, JavaScript has no image processing libraries.

Better use a Java Applet?
__________________
Harsh J
www.harshj.com
QwertyManiac is offline  
Old 25-02-2008, 09:13 PM   #7 (permalink)
The Frozen Nova
 
casanova's Avatar
 
Join Date: Sep 2004
Location: Trespasser in Virtual Land
Posts: 1,641
Default Re: Javascript wanted

I would be running that off my comp itself. I would be triggering this from a software that I use which supports calling Javascripts.
__________________
I dream of a better tomorrow... where chickens can cross roads and not have their motives questioned.

www.nerdweed.blogspot.com
casanova is offline  
Old 25-02-2008, 09:19 PM   #8 (permalink)
Wahahaha~!
 
Faun's Avatar
 
Join Date: Dec 2006
Location: Pune/there
Posts: 7,675
Default Re: Javascript wanted

Quote:
Originally Posted by casanova View Post
I would be running that off my comp itself. I would be triggering this from a software that I use which supports calling Javascripts.
may be u could use JSP for that if its a web app.
__________________
Blog | Flickr | Battlelog
Spoiler:
Asus Z68 V-Pro|i5 2500k|TRUE Black|Ripjaws X|U2311H|N560GTX|D7000|XONAR STX|RE272|RE0|CC51|XE200PRO Walnut| TD II V2| Ultraphile|N5800

Mono
Faun is online now  
Old 25-02-2008, 09:38 PM   #9 (permalink)
The Frozen Nova
 
casanova's Avatar
 
Join Date: Sep 2004
Location: Trespasser in Virtual Land
Posts: 1,641
Default Re: Javascript wanted

Its not a web app. Sadly, I can't manage to do this on my own as I have never handled images previously and completely out of coding these days.

A brief description on how I would make the script act,
1. An image in a particular folder would be changed regularly
2. Once this image is changed, the javascript would be triggered. Incase there is a tiny application that can do that and exit, it would be fine as well.

Found this algorithm. No idea on how to implement it though
__________________
I dream of a better tomorrow... where chickens can cross roads and not have their motives questioned.

www.nerdweed.blogspot.com

Last edited by casanova; 25-02-2008 at 10:22 PM. Reason: Adding link to an algorithm
casanova is offline  
Old 25-02-2008, 11:38 PM   #10 (permalink)
Commander in Chief
 
QwertyManiac's Avatar
 
Join Date: Jul 2005
Posts: 6,658
Default Re: Javascript wanted

I don't get your idea even now, what language are you writing your software in? Doesnt it have image libraries?

JS can't help with images, forget it. Nor does it allow calling other executables, so using it as a link is not possible as well.
__________________
Harsh J
www.harshj.com
QwertyManiac is offline  
Old 25-02-2008, 11:42 PM   #11 (permalink)
Wahahaha~!
 
Faun's Avatar
 
Join Date: Dec 2006
Location: Pune/there
Posts: 7,675
Default Re: Javascript wanted

Quote:
Originally Posted by QwertyManiac View Post
I don't get your idea even now, what language are you writing your software in? Doesnt it have image libraries?

JS can't help with images, forget it. Nor does it allow calling other executables, so using it as a link is not possible as well.
yup thats the security measure.

u may consider M$ .Net

Can u be less terse, elaborate it concisely.
__________________
Blog | Flickr | Battlelog
Spoiler:
Asus Z68 V-Pro|i5 2500k|TRUE Black|Ripjaws X|U2311H|N560GTX|D7000|XONAR STX|RE272|RE0|CC51|XE200PRO Walnut| TD II V2| Ultraphile|N5800

Mono

Last edited by Faun; 26-02-2008 at 06:20 AM. Reason: sorry, misspelt
Faun is online now  
Old 26-02-2008, 01:30 AM   #12 (permalink)
Alpha Geek
 
Krazy_About_Technology's Avatar
 
Join Date: Jun 2004
Location: Noida - India
Posts: 765
Default Re: Javascript wanted

Quote:
u may consider M$ .Nert
Yaar, is it always required to use this language with all things MS, whether good or bad . Its quiet annoying.

Anyways, Yup, a .NET app will do i think, whether a Windows Form or Web app. There is not much diff anyways in .NET. Even with aspx pages, code running on server will have full access to whatever resource you want.
__________________
Dell Inspiron 1525 - C2D 2 Ghz, 3GB, 250GB, X3100 :)

Samsung Omnia Pro B7610 with Stock WM 6.1 ROM

Blog: http://www.sumitbhardwaj.co.in/blog
Krazy_About_Technology is offline  
Old 26-02-2008, 07:06 AM   #13 (permalink)
The Frozen Nova
 
casanova's Avatar
 
Join Date: Sep 2004
Location: Trespasser in Virtual Land
Posts: 1,641
Default Re: Javascript wanted

Quote:
Originally Posted by QwertyManiac
I don't get your idea even now, what language are you writing your software in? Doesnt it have image libraries?
I haven't written any softy. But a few of the softwares I use allow calling a javascript.

Quote:
Originally Posted by QwertyManiac
JS can't help with images, forget it. Nor does it allow calling other executables, so using it as a link is not possible as well.
Good that I asked first rather than jus googling for the impossible.

Can it possible with a VB script. This does allow calling an exe for sure, can it handle images
__________________
I dream of a better tomorrow... where chickens can cross roads and not have their motives questioned.

www.nerdweed.blogspot.com
casanova is offline  
Old 26-02-2008, 07:10 AM   #14 (permalink)
Dreamweaver
 
Gigacore's Avatar
 
Join Date: Aug 2006
Location: Bangalore
Posts: 3,904
Default Re: Javascript wanted

I use a JS in one of my sites, which can handle images and picks up the color from it. I think it can't be used in ur case.
__________________
Today's noobs are tomorrow's geeks. Don't make fun of them.. encourage them. - Gigacore

Follow me on twitter.com/gigacore
Gigacore is offline  
Old 26-02-2008, 10:23 AM   #15 (permalink)
The Frozen Nova
 
casanova's Avatar
 
Join Date: Sep 2004
Location: Trespasser in Virtual Land
Posts: 1,641
Default Re: Javascript wanted

If it picks up the most frequent color, then I think it might be what I was looking for.
__________________
I dream of a better tomorrow... where chickens can cross roads and not have their motives questioned.

www.nerdweed.blogspot.com
casanova is offline  
Old 26-02-2008, 11:11 AM   #16 (permalink)
Dreamweaver
 
Gigacore's Avatar
 
Join Date: Aug 2006
Location: Bangalore
Posts: 3,904
Default Re: Javascript wanted

^ it wont. It can just pic one color at a time. Infact its a color palette JS. But maybe you can play with the codes. You can find the js here: http://johndyer.name
__________________
Today's noobs are tomorrow's geeks. Don't make fun of them.. encourage them. - Gigacore

Follow me on twitter.com/gigacore
Gigacore is offline  
Old 26-02-2008, 11:55 AM   #17 (permalink)
The Frozen Nova
 
casanova's Avatar
 
Join Date: Sep 2004
Location: Trespasser in Virtual Land
Posts: 1,641
Default Re: Javascript wanted

Not what I need.

i just came across this vbscript

I wonder if it can be tailored to fit my needs
__________________
I dream of a better tomorrow... where chickens can cross roads and not have their motives questioned.

www.nerdweed.blogspot.com
casanova is offline  
Old 03-03-2008, 12:52 PM   #18 (permalink)
The Frozen Nova
 
casanova's Avatar
 
Join Date: Sep 2004
Location: Trespasser in Virtual Land
Posts: 1,641
Default Re: Javascript wanted

I have now managed to write an algorithm that would do my job. Can some1 convert this algorithm to vbscript or a javascript

Quote:
image=read_the_image(d:\casanova.jpg)
colours_found=0
width=get_image_width(image)
height=get_image_height(image)

for (i=0;i<width;i++)
{
for (j=0;j<height;j++)
{
new_colour_found=1 //treat as is this is a new colour
pixel_colour=get_colour_at(i,j)
for (k=0;k<colours_found;k++)
{
if (colour[k][0]=pixel_colour)
{
colour[k][1]=colour[k][1]+1
new_colour_found=0 //this colour is not new
break
}
}
if (new_colour_found=1)
{
colours_found=colours_found+1
colour[colours_found][0]=pixel_colour
colour[colours_found][1]=1
}
}
}


max[0][1]=0
//finding the most frequent colour
for (k=0;k<colours_found;k++)
{
if (colour[k][1]>max[0][1])
{
max[0][0]=colour[k][0]
max[0][1]=colour[k][1]
}
}
set_desktop_background_colour(max[0][0])
__________________
I dream of a better tomorrow... where chickens can cross roads and not have their motives questioned.

www.nerdweed.blogspot.com
casanova is offline  
Closed Thread

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
I need help with javascript. Kalyan QnA (read only) 1 17-08-2007 07:07 PM
Help on cookies wanted (javascript) Sridhar_Rao Tutorials 4 22-03-2007 07:14 PM
Javascript Help REY619 QnA (read only) 5 21-02-2007 09:31 PM
[b]HELP WANTED:: WINRAR FAILS 2 UNRAR :: HELP WANTED[/b] softhunterdevil Software Q&A 5 02-01-2006 04:54 PM
JavaScript help......... shehan9999 QnA (read only) 4 05-12-2004 06:34 PM

 
Latest Threads
- by Charan
- by Sarath
- by clmlbx

Advertisement




All times are GMT +5.5. The time now is 12:52 AM.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2012, vBulletin Solutions, Inc.

Search Engine Optimization by vBSEO 3.3.2