Comments (6)
Why do you want to decompress to raw?
JPEG2000 usually converts RGB to YUV, and stores the Y, U, and V components. Most implementations, including OpenJPH, do that,
The difficulty I face is when we save to raw or yuv, do we save RGB or the internal YUV? Note that U and V can be signed components -- I need to check about signedness.
This can be supported with command line options, but I do not currently give these options.
For your case, I would recommend saving to ppm. It is a very simple format.
There is a short header followed by interleaved image data. so you have
RGB for first pixel, RGB for second pixel and so on.
Data can be 8-bit or big-endian 16-bit.
Hope this helps.
from openjph.
Why do you want to decompress to raw?
JPEG2000 usually converts RGB to YUV, and stores the Y, U, and V components. Most implementations, including OpenJPH, do that,
The difficulty I face is when we save to raw or yuv, do we save RGB or the internal YUV? Note that U and V can be signed components -- I need to check about signedness. This can be supported with command line options, but I do not currently give these options.
For your case, I would recommend saving to ppm. It is a very simple format. There is a short header followed by interleaved image data. so you have RGB for first pixel, RGB for second pixel and so on. Data can be 8-bit or big-endian 16-bit.
Hope this helps.
Ok, couple of questions.
-
While decompressing into to PPM format , Is their any way to know whether pixel data is in RGB or YUV format or PPM only stores in RGB.
-
Is their anyway to know , how pixel is organized, interleaved or planner while decompression into PPM format?
from openjph.
It is always RGB.
It is always interleaved, as in
R first pixel, G first pixel, B first pixel, R second pixel, G second pixel, B second pixel.
See https://netpbm.sourceforge.net/doc/ppm.html
The code of class ojph::ppm_in in ojph_img_io.h, ojph_img_io.cpp can read pgm/ppm, where pgm is a single color file.
I noticed there is the variable plannar in ppm_in, but it is never used and should be removed.
Forgot to say nobody uses ASCII format, AFAIK, because it is not efficient. So don't worry about it.
from openjph.
It is always RGB. It is always interleaved, as in R first pixel, G first pixel, B first pixel, R second pixel, G second pixel, B second pixel. See https://netpbm.sourceforge.net/doc/ppm.html The code of class ojph::ppm_in in ojph_img_io.h, ojph_img_io.cpp can read pgm/ppm, where pgm is a single color file. I noticed there is the variable plannar in ppm_in, but it is never used and should be removed.
Forgot to say nobody uses ASCII format, AFAIK, because it is not efficient. So don't worry about it.
ok, I wrote simple bufferwriter
to receive decompressed pixel data in memory buffer based on the raw_out implementation for grayscale , class BufferWriter : public ojph::image_out_base
For color I am planning implement based on the ppm_out .
Here is the use case where I need to pixel data to be updated in the DICOM file
from openjph.
Excellent!
I think this should work.
For your output, you need to buffer the 3 color components in memory before writing them out, or perhaps sending them out to next stage.
It should be simpler than ppm_out because you have no headers, and you do not need to interleave the color components.
from openjph.
I am closing this due to no activity.
from openjph.
Related Issues (20)
- typo in CMakeLists.txt HOT 1
- ojph_compress support for uppercase file extensions HOT 1
- signed 16bit negative values mismatch in interoperablity test between openjph and kakadu HOT 2
- Incorrect COM marker length HOT 1
- openjph decompression fails HOT 2
- Build should not fail if SIMD optimizations are enabled and your CPU doesn't support them HOT 2
- Feature: Support ROI based rendering HOT 1
- Sample JPH images, please HOT 5
- Unable to build using MinGW HOT 3
- Apple silicon build error HOT 5
- Support decode/expand a j2c file with just tilepart bytes HOT 2
- Tests fails to pass in version 0.10.4 HOT 2
- Specifying non-standard binary and library directories complicates integration in other projects HOT 1
- Feature Request: Add support for vcpkg HOT 1
- Encode 115x25的YUV444 picture,There is serious distortion. HOT 4
- Automated Testing Improvements HOT 1
- Remove xcode specific files HOT 1
- The block coder should be usable without pulling in the rest of OpenJPH HOT 6
- Removing the ojph_ prefix. HOT 6
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from openjph.