- This topic has 5 replies, 4 voices, and was last updated 2 years, 11 months ago by
Xaveer.
-
AuthorPosts
-
12 December 2018 at 07:12 #5351
Pervaiz
MemberHi,
I am having an issue when I try to convert some image into GDS. I am following the example code provided in the tutorial section (https://nazca-design.org/convert-image-to-gds/). It seems that nazca.image doesn’t exist anymore. I also checked util.image, unfortunately, the result is the same error. Can someone please guide me that how to convert an image to GDS using nazca 0.9.1 ?
Thanks!
12 December 2018 at 07:21 #5353Ronald
KeymasterDear Pervaiz,
Note that Nazca Design is at version 0.4.3. Hence, the version number you mention (0.9.1) is very helpful in identifying that you have another unrelated nazca package alltogether.
If you follow the installation on https://nazca-design.org/installation/ you should be fine.
Ronald
12 December 2018 at 08:30 #5354Pervaiz
MemberHi Ronald,
Thanks a lot. Yes, that was the issue. I think it would be better if it is mentioned somewhere on the homepage that directly using “pip install nazca” will actually install some different package.
Thanks again.
21 March 2022 at 03:22 #6752bhchoi98
ParticipantHi, I’m suffering the same problem with Pervaiz.
I manually installed the latest version of the nazca (0.5.13), but following error occurs:
AttributeError: module ‘nazca’ has no attribute ‘image’
Which version should I use? The latest version does not support image attribute anymore?
-
This reply was modified 2 years, 11 months ago by
bhchoi98.
21 March 2022 at 09:41 #6754Ronald
KeymasterDear bhchoi98,
I think this was solved in the answer to Pervaiz:
If you follow the installation on https://nazca-design.org/installation/ you should be fine.
“pip install nazca” is an unrelated package to Nazca Design.
Ronald
22 March 2022 at 06:51 #6756bhchoi98
ParticipantHi Ronald,
Thanks for the reply. I installed nazca again as installation guide, and now it works fine.
Actually i have one more question about ‘image’ attribute of nazca package.
As the following tutorial: https://nazca-design.org/convert-image-to-gds/, I tried to invert the image as below.
nd.image(‘image.jpg’, invert=True).put(1000)
nd.export_gds()
But the output’s size was not the same as the input (e.g. 1000 by 1000 png file-> 1000 mircombeter by 800 micrometer).
Do you know how to solve this problem?
Thank you.
24 March 2022 at 10:25 #6763Xaveer
ModeratorDear bhchoi98,
It should work as advertised. The default pixel size is one micron and the default image size is 256 pixels. You can change both. Keeping the default pixel size, this code produces both the normal and the inverted picture. Note that put(1000) will put the center of the image at (1000, 0) microns in the GDS file and that the size argument changes the resolution of the picture in the GDS file (it’s size in pixels).
import nazca as nd
nd.image(‘testimg.png’, size=1000, invert=True, layer=1).put(1000)
nd.image(‘testimg.png’, size=1000, invert=False, layer=2).put(1000)
nd.export_gds()See the documentation at https://nazca-design.org/manual/nazca.html?highlight=image#nazca.bb_util.image
Hope that works.
Xaveer
-
This reply was modified 2 years, 11 months ago by
-
AuthorPosts
- You must be logged in to reply to this topic.