The Origin Forum
File Exchange
Try Origin for Free
The Origin Forum
Home | Profile | Register | Active Topics | Members | Search | FAQ | Send File to Tech support
 All Forums
 Origin Forum
 Origin Forum
 Import palette from image file

Note: You must be registered in order to post a reply.
To register, click here. Registration is FREE!

Screensize:
UserName:
Password:
Anti-Spam Code:
Format Mode:
Format: BoldItalicizedUnderlineStrikethrough Align LeftCenteredAlign Right Horizontal Rule Insert HyperlinkUpload FileInsert Image Insert CodeInsert QuoteInsert List
   
Message:

* HTML is OFF
* Forum Code is ON
Smilies
Smile [:)] Big Smile [:D] Cool [8D] Blush [:I]
Tongue [:P] Evil [):] Wink [;)] Clown [:o)]
Black Eye [B)] Eight Ball [8] Frown [:(] Shy [8)]
Shocked [:0] Angry [:(!] Dead [xx(] Sleepy [|)]
Kisses [:X] Approve [^] Disapprove [V] Question [?]

 
Check here to subscribe to this topic.
   

T O P I C    R E V I E W
AKazak Posted - 08/17/2021 : 02:09:12 AM
OriginPro 2022 (64-bit) Beta2 9.9.0.105
Windows 7 SP1 x64

Greetings!

I have an image file with the palette I want to use in Origin.
What is the easiest way to import the image file as a palette via the Color Manager.

Currently it seems to be not straightforward at all.

Thank you.

---
Andrey
15   L A T E S T    R E P L I E S    (Newest First)
AKazak Posted - 08/18/2021 : 3:35:47 PM
quote:
Originally posted by easwar

Hi Andrey,

While we are looking into a better solution, here is a somewhat quirky workaround:

1> Import your image into a matrix window
2> Create a blank workbook and set column A as Text (default is text and numeric)
3> Go to the matrix, set as data view, click and select the first column and do ctrl+c
4> Go to worksheet, click on 1st row cell in col A and do CTRL+V. The RGB values get pasted into three separate columns

This works fine as all colors across the rows are same in your image of course.
5> Now start the Color Editor app, then copy the three columns from the earlier worksheet and paste into the RGB columns in the color editor workbook. You can now save as palette.

Easwar
OriginLab




Dear Easwar,

Thank you for sharing a very nice workflow.
Well done!


---
Andrey
easwar Posted - 08/18/2021 : 12:42:33 PM
Hi Andrey,

While we are looking into a better solution, here is a somewhat quirky workaround:

1> Import your image into a matrix window
2> Create a blank workbook and set column A as Text (default is text and numeric)
3> Go to the matrix, set as data view, click and select the first column and do ctrl+c
4> Go to worksheet, click on 1st row cell in col A and do CTRL+V. The RGB values get pasted into three separate columns

This works fine as all colors across the rows are same in your image of course.
5> Now start the Color Editor app, then copy the three columns from the earlier worksheet and paste into the RGB columns in the color editor workbook. You can now save as palette.

Easwar
OriginLab
easwar Posted - 08/18/2021 : 12:07:43 PM
Hi Andrey,

Please try the following:
1> Use the Color Editor App
2> Click the "Extract Image Colors" button and select your image
3> Set the number of colors to be low such as 12 and get the colors
4> Sort the worksheet ascending or descending based on the "Rel Luminance" column
5> Click the "Interpolate" button to interpolate the sorted list to say 256 colors
6> Click "Save Palette" to save the palette with desired name.

As for step 3, we are using a Python plugin to get color values. This plug-in seems to not work well in that if you set color count to be higher, it just finds/fills colors that do not even exist in the image! It just may be a limitation of the plugin, we have to look into it further.

Easwar
OriginLab
AKazak Posted - 08/18/2021 : 11:26:39 AM
quote:
Originally posted by snowli

Do you mind sharing the image file and also let me know how many unique number of colors there should be.

I can ask someone who is familiar with python to check.

BTW, does Extract image color in Color Editor app finds more colors with your image? I saw that can specify how many colors to pick. The max is 256.

Thanks, snow



Dear Snow,

Sure, please see the image attached below:


---
Andrey
snowli Posted - 08/18/2021 : 09:50:33 AM
Do you mind sharing the image file and also let me know how many unique number of colors there should be.

I can ask someone who is familiar with python to check.

BTW, does Extract image color in Color Editor app finds more colors with your image? I saw that can specify how many colors to pick. The max is 256.

Thanks, snow
AKazak Posted - 08/18/2021 : 09:14:11 AM
quote:
Originally posted by snowli

Then please try Image Color.otwu.
File: New: Workbook: Image Colors.otwu.
Click Run Python Code and choose the image file you saved.
It will generate RGB columns and html color column.

Thanks, Snow




I tested, but the real number of unique image colors are far greater than that produced by Image Color.otwu.
Is this OK?


---
Andrey
AKazak Posted - 08/18/2021 : 09:05:11 AM
quote:
Originally posted by snowli

Then please try Image Color.otwu.
File: New: Workbook: Image Colors.otwu.
Click Run Python Code and choose the image file you saved.
It will generate RGB columns and html color column.

Thanks, Snow




Dear Snow,

Thank you for the nice suggestion!

---
Andrey
snowli Posted - 08/18/2021 : 08:57:31 AM
Then please try Image Color.otwu.
File: New: Workbook: Image Colors.otwu.
Click Run Python Code and choose the image file you saved.
It will generate RGB columns and html color column.

Thanks, Snow
AKazak Posted - 08/18/2021 : 01:16:27 AM
quote:
Originally posted by snowli

I am not sure what's your user story?
Is it an image imported to matrix object? Why not using the Image Colors.otwu to get colors from the image file.

For RGB in matrix, i can only think of using Image: Conversion: RGB split to R, G, and B values into different matrix and then using Convert to worksheet for each to put them into worksheet.
Then put the to R, G, B columns in Color Editor App.

Thanks, Snow



My story is the following. I see a nice color scale in a publication and want to have the corresponding color palette in Origin. I screenshot the color scale in publication and save the cropped screenshot of the color scale as an image file. Now I want to convert this image file to an Origin color palette.

---
Andrey
snowli Posted - 08/17/2021 : 11:58:13 AM
You can do Matrix: Convert to Worksheet with XYZ columns first. It will generate Z value with RGB composite
Then use Set Column Value to convert the color composite to R, G and B values.


BTW, i jiraed it so convert image matrix to worksheet will output color into color column
ORG-24010 P2

Thanks, Snow
snowli Posted - 08/17/2021 : 11:45:37 AM
I am not sure what's your user story?
Is it an image imported to matrix object? Why not using the Image Colors.otwu to get colors from the image file.

For RGB in matrix, i can only think of using Image: Conversion: RGB split to R, G, and B values into different matrix and then using Convert to worksheet for each to put them into worksheet.
Then put the to R, G, B columns in Color Editor App.

Thanks, Snow
AKazak Posted - 08/17/2021 : 10:33:36 AM
quote:
Originally posted by snowli

Hi Andrey,

No matter which tool you used, when a column is set as Color type, click the column header, there is a mini toolbar button to save it as palette or color list depending on how many colors in the coloumn..
If many colors, it's saved as palette file (pal). If not a lot of colors, it's saved as color list file (oth)

There is a system variable for the threshold @MPS.

Thanks, Snow




Dear Snow,

Got it!
Last question: how do I put an RGB color column from a matrix object to the Color Editor App?

---
Andrey
snowli Posted - 08/17/2021 : 09:27:27 AM
Hi Andrey,

No matter which tool you used, when a column is set as Color type, click the column header, there is a mini toolbar button to save it as palette or color list depending on how many colors in the coloumn..
If many colors, it's saved as palette file (pal). If not a lot of colors, it's saved as color list file (oth)

There is a system variable for the threshold @MPS.

Thanks, Snow
AKazak Posted - 08/17/2021 : 05:54:43 AM
quote:
Originally posted by yuki_wu

Hi Andrey,

Do you want to extract the image colors?

If so, you can use Color Editor App:
https://www.originlab.com/FileExchange/details.aspx?fid=317

Or

Use Image Colors.otwu workbook template by selecting File: New: Workbook

Regards, Yuki




Dear Yuki,

OK, I extracted the color codes.
Now, how do I create a palette file?

---
Andrey
yuki_wu Posted - 08/17/2021 : 04:43:58 AM
Hi Andrey,

Do you want to extract the image colors?

If so, you can use Color Editor App:
https://www.originlab.com/FileExchange/details.aspx?fid=317

Or

Use Image Colors.otwu workbook template by selecting File: New: Workbook

Regards, Yuki

The Origin Forum © 2020 Originlab Corporation Go To Top Of Page
Snitz Forums 2000