Closed yaqwsx closed 4 years ago
While the Photon-format is essentially the cbddlp-format, there are some slight differences. As far as I understood the elegoo mars uses that format. I am currently working on the next version which is nearly complete, but needs some additional testing and fixes. This version will be compatible with the cbddlp-format. You can check out the development branch if you are interessted. Otherwise I will try to finish the next version in the next days, but I currently don't have a lot of time, so no promises. Unfortunately this will came with some breaking changes for the lib, but nothing complicated. During testing I will also try to replicate and fix your problem.
I released v0.2.0 with support for the generic cbddlp and therefore elegoo mars format. I did try to import and export your model and that worked. I did not try to modify the image directly like you did in your code. Could you please test your code against the new version? If you still have a problem, let me know and I will look into this a bit more.
The new file format seems to work well, thank you! At least for the compensate command in my utility.
However, when I call the dump command, I get:
Traceback (most recent call last):
File "/usr/lib/python3/dist-packages/PIL/Image.py", line 2515, in fromarray
mode, rawmode = _fromarray_typemap[typekey]
KeyError: ((1, 1), '<i8')
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "./elegoUtil.py", line 57, in <module>
cli()
File "/home/xmrazek7/.local/lib/python3.7/site-packages/click/core.py", line 764, in __call__
return self.main(*args, **kwargs)
File "/home/xmrazek7/.local/lib/python3.7/site-packages/click/core.py", line 717, in main
rv = self.invoke(ctx)
File "/home/xmrazek7/.local/lib/python3.7/site-packages/click/core.py", line 1137, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File "/home/xmrazek7/.local/lib/python3.7/site-packages/click/core.py", line 956, in invoke
return ctx.invoke(self.callback, **ctx.params)
File "/home/xmrazek7/.local/lib/python3.7/site-packages/click/core.py", line 555, in invoke
return callback(*args, **kwargs)
File "./elegoUtil.py", line 51, in dump
photon.export_images('tempdir')
File "/usr/local/lib/python3.7/dist-packages/pyphotonfile-0.2.0-py3.7.egg/pyphotonfile/photonfile.py", line 381, in export_images
File "/usr/local/lib/python3.7/dist-packages/pyphotonfile-0.2.0-py3.7.egg/pyphotonfile/photonfile.py", line 388, in export_image
File "/usr/lib/python3/dist-packages/PIL/Image.py", line 2517, in fromarray
raise TypeError("Cannot handle this data type")
TypeError: Cannot handle this data type
Also, could you help me to understand the new file format? Do I understand correctly that the images are still encoded in black & white, however, there are AA-level
of them per layer? And the printer displays them one after other for 1/AA-level
*exposure-time
?
Did you install pillow as the PIL alternative or PIL directly? Maybe this is a version conflict. I never experienced this problem and the "export_images" method is basically used in all my test code. Could you try the Pillow version shown in the requirements.txt and let me know if this is the problem?
And regarding the layer / sublayers. I will write a quick rundown for the main README.md, but the gist is that you have in the basic 'anti-aliasing=1' setting one image for each layer. If you have an anti-aliasing level of 2, you have two images for each layer, which get illuminated directly after each other. I changed the internal layers to always have at least 1 sublayer so that the code does not have to distinguish between anti aliasing and not. Having said that, I have no clue about the elegoo mars and anti-aliasing :).
This is the result of pip3 freeze
freeze.txt
Thank you for the clarification - the most important part is that I can use binary erosion in my utility.
BTW: Would you mind updating the library on PIP so I can put is as a dependency of my project?
Strange. Give me a day and I will look further into this. The pip version will be released once this version proves to be stable and no new issues surface. I am hoping for 1-2 weeks.
I cloned and installed your tool in a new venv with python 3.7. I also installed pyphotonfile according to your manual. I then installed all missing dependencys. The resulting packages according to pip freeze are:
Click==7.0
cycler==0.10.0
decorator==4.4.0
imageio==2.5.0
kiwisolver==1.1.0
matplotlib==3.1.1
networkx==2.3
numpy==1.17.2
Pillow==6.1.0
pyparsing==2.4.2
pyphotonfile==0.2.0
PySide2==5.13.1
python-dateutil==2.8.0
PyWavelets==1.0.3
scikit-image==0.15.0
scipy==1.3.1
shiboken2==5.13.1
six==1.12.0
The dump command works perfectly fine! Your packages show that you have installed Pillow==5.4.1
while I have Pillow==6.1.0
installed. This could be the problem. Would you mind trying that out?
Anyway, nice seeing the lib used for something else than my work :)
I suspect that eveything is working now. If not, please let me know. I will close this for now.
Do you consider the version 0.2 as tested enough? When do you plan to release it on pypi?
Hello,
I want to use your library for Elegoo Mars as the internet resources claim the file format is exactly the same. However, in my project (https://github.com/yaqwsx/ElegooMarsUtilitiy) I observe two problems:
xyCompensate
I try to change the slices. However, the resulting file is much smaller than the original one and the ChiTuBox displays it as emptydump
command triggers a backtrace:Both of them can be reproduced by running them on input.zip
Am I using your library wrong or is there some kind of compatibility issue?