Jump to content

A way to collect all the different pixel colours of a picture?


Recommended Posts

so, 16777215 is actually a decimal right? The converters online seem to cut off the last few numbers or say that the numbers have to be 255 or less. Am I trying to convert it incorrectly?

16777215 should be FFFFFF in hex :)

Don't forget to type 0xFFFFFF in autoit!

Edited by Qousio
Link to comment
Share on other sites

  • Replies 43
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic

so, 16777215 is actually a decimal right? The converters online seem to cut off the last few numbers or say that the numbers have to be 255 or less. Am I trying to convert it incorrectly?

I had this script sitting around, might work for you.

#Include <Array.au3>
#Include <File.au3>
#Include <String.au3>
Opt("TrayIconDebug",1);;;DEBUG
$a = FileOpenDialog("Please choose file to remove duplicates from", @ScriptDir & "\", "Text Documents (*.txt)", 1)
$b = FileOpenDialog("Please choose file to output to", @ScriptDir & "\", "Text Documents (*.txt)", 9)
$file = fileopen($b,1)
Dim $Darray
Dim $Darray2[1]
_FileReadToArray($a,$Darray)
_ArrayDelete($Darray,0)
_ArraySort($Darray)
$y = ubound($Darray)
tooltip($y)
FileWriteLine($file,$Darray[0])
$place = $Darray[0]
For $i = 1 to ubound($Darray) - 1
    $it = $Darray[$i]
    If $it <> $place then
        FileWriteLine($file,$Darray[$i])
        $place = $it
    Endif
tooltip($i & " out of " & $y)
Next
fileclose($file)
$CountLines = _FileCountLines($b)
$del = $y - $CountLines
msgbox(0,"Deleted","Starting lines in file: " & $y & @CRLF & "Lines in output file: " & $CountLines)
msgbox(0,"Deleted", $del & "lines have been deleted.)
Link to comment
Share on other sites

QUOTE (RAMMRODD @ May 10 2009, 07:41 PM)

I used the script you posted Qousio, and I get the long decimals. But now how do I translate that into an actual color? I got numbers like 16777215, which isnt hex or Decimal (that I could find with Google) the numbers seem to long. Did I mess up or is there a prerequisite before they can be used as a common hex or decimal color?

BTW Thanks for the script I've been wondering how to do this for a while. So I appreciate your work.

Chad

EDIT: was looking at another post Qousio is involved in and saw numbers very similar to mine, so off to google I go searching for a translation.

Which code did you use? The latest one? How did you get it to work? Doesn't work for me.

I used that latest one. I just opened a picture in a previewer and ran the script. It put up a ton ( I mean a ton!) of X,Y is <string of numbers> I may have did it wrong but it pulled up numbers like I expected.

@Qousio what did you use to convert that?

@foster dont have time to test it but thanks for posting....will get to it after my final (Tues 11am Central....wish me luck!!)

Link to comment
Share on other sites

I used that latest one. I just opened a picture in a previewer and ran the script. It put up a ton ( I mean a ton!) of X,Y is <string of numbers> I may have did it wrong but it pulled up numbers like I expected.

@Qousio what did you use to convert that?

@foster dont have time to test it but thanks for posting....will get to it after my final (Tues 11am Central....wish me luck!!)

Did you just put Sorted.txt into the same directory as the au3 file and run the au3?

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...