Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Activity
  • 10:09
    codecov[bot] commented #986
  • 10:09
    codecov[bot] commented #986
  • 10:06
    JimBobSquarePants commented #986
  • 09:59
    Sergio0694 commented #986
  • 09:48
    Sergio0694 commented #828
  • 07:40
    IldarKhayrutdinov commented #986
  • 07:28
    IldarKhayrutdinov commented #986
  • 07:26
    IldarKhayrutdinov commented #986
  • 07:17
    IldarKhayrutdinov synchronize #986
  • 03:55
    James-Jackson-South commented #986
  • Aug 22 23:30
    antonfirsov commented #986
  • Aug 22 23:29
    antonfirsov commented #986
  • Aug 22 23:28
    antonfirsov commented #986
  • Aug 22 23:22
    antonfirsov commented #986
  • Aug 22 19:44
    MattWhilden commented #828
  • Aug 22 18:26
    IldarKhayrutdinov synchronize #986
  • Aug 22 18:24
    MattWhilden commented #828
  • Aug 22 15:28
    Sergio0694 commented #828
  • Aug 22 15:18
    ivanrlg commented #828
  • Aug 22 13:18
    IldarKhayrutdinov edited #986
Anton Firsov
@antonfirsov
sounds cool! you might be also interested in Image.WrapMemory(...)
Jérémy VIGNELLES
@jeremyVignelles
another issue I have is that I need to align the buffers on multiples on 32 pixels. I then need to crop the picture. I didn't see yet if it's possible with ImageSharp
What is WrapMemory for?
Anton Firsov
@antonfirsov
pretty advanced stuff, needs deep understanding of Span<T>, Memory<T> and MemoryManager<T>, but you can probably avoid saving temporary pixel buffer files
it warps an existing memory area as an Image<TYourPixelType> without copying data
Jérémy VIGNELLES
@jeremyVignelles
I've already used Span<T> and Memory<T> before, but not MemoryManager
I see...
Don't know how I could pass that to libvlc though...
I'm trying to make it work first
Anton Firsov
@antonfirsov
Ok, I thought you are consuming data from libvlc buffers
jongleur1983
@jongleur1983
@jeremyVignelles the question is: can you get the memory block FROM libvlc and wrap it?
Jérémy VIGNELLES
@jeremyVignelles
@antonfirsov : I'm creating a buffer for libvlc to write into
So I think that would be doable
Anton Firsov
@antonfirsov
then it writes pixel data, and you try to interpret it and encode it using ImageSharp?
Jérémy VIGNELLES
@jeremyVignelles
Right, but I crop before sending that to ImageSharp for now
I managed to get pictures saved from ImageSharp. My main issues are on libvlc for now
mainly : the lack of documentation.
For example, I know I can get something else than RGB from libvlc, like YUV.
Anton Firsov
@antonfirsov
can't you ask it to provide data in a pixel format defined by you?
Jérémy VIGNELLES
@jeremyVignelles
no, I set a 4CC codec, like "RV32"
Anton Firsov
@antonfirsov
damn, we have builtin stuff for YCbCr conversion, but I think we have nothing for YUV
Jérémy VIGNELLES
@jeremyVignelles
I'm trying to limit the number of frame per seconds on libvlc
@antonfirsov : I'm building a sample code, It doesn't need to be really optimized
just so that people stop asking me how to do that
Anton Firsov
@antonfirsov
just so that people stop asking me how to do that
I can feel your pain :D
Jérémy VIGNELLES
@jeremyVignelles
:sweat_smile:
jongleur1983
@jongleur1983
@antonfirsov currently I don't get the decoding errors any more, but it looks like the android device takes ages to actually save the jpeg to the storage. As that's asynchronous (which I didn't realize, starting with a code sample) my "read file and analyze with ImageSharp) sometimes tried to access invalid, empty or even non-existing files and that crashed. Now using a watcher on the file system that seems to be solved (although the delay is incredible long)
Sergio Pedri
@Sergio0694
Hey @JimBobSquarePants - sorry for the delay with the build fix for the tests!
I won't actually be back home until this wednesday, and as I've mentioned over here I barely have internet and it's difficult for me to do as much as I'd like.
Glad that last part was a quick fix for you though, let me know if there's anything else I can help you guys with! 😊
jongleur1983
@jongleur1983
App is working now. Taking a picture, storing to disc and waiting for the FileClose-Event on the file system (takes ~90seconds - no idea, why), then reading the file using ImageSharp (decoding takes ~20 seconds for 4000x3000 px), calculating red-channel-histogram (more or less instant) and reporting the value to the UI.
Anton Firsov
@antonfirsov
@jongleur1983 is the image you save also 4000 x 3000 ?
jongleur1983
@jongleur1983
yes
taking the picture, saving it (4000x3000 px jpeg stream from camera), loading it and iterating over the pixels
I had a very very rough comparison for ImageSharp compared to the Android Bitmap though: Android Bitmap loads JPEG much faster (not recognizable by the user, didn't measure), but iterating over all pixels and extracting the red component took ~5 minutes.
Using ImageSharp, Decoding the file (so: the Image.Load() command) took ~1 minute, but iterating was instant enough to not get any visible progress output
hope to find the time to do some proper benchmarking later
James Jackson-South
@JimBobSquarePants
@jongleur1983 is that perf the same for other image formats or just jpeg?
@Sergio0694 Don’t worry at all! I’ve got the tests building and have started on IDisposable conversion. I’ll keep plugging away 🙂
jongleur1983
@jongleur1983
@JimBobSquarePants didn't check, yet. Camera only gives Jpeg or Raw, so jpeg is the only option yet for that use case. Going to do some more research about it later
Tyler M
@TylerDM
Is there a recommended way to save Image<Rgba32> to a stream without an encoding (or similarly, the most efficient way)? This is for a temp folder that gets cleared on application start; so I don't even need interoperability with other versions of Image Sharp.
James Jackson-South
@JimBobSquarePants
Without encoding? As in save the raw pixel bytes?
Peter Tribe
@equinox2k
@JimBobSquarePants i craeted this PR SixLabors/Shapes#68 dont know if there is a problem with CLA as ive signed it but seems to not reflect me doing it. Plus i assume i need to get Shapes Updated first before i can then update ImageSharp to send the options
this is all in order to get SVG rendering working correctly
James Jackson-South
@JimBobSquarePants
@tocsoft will be able to give the CLA tool a kick to check again. Sometimes it seems to get stuck
Peter Tribe
@equinox2k
kicked it myself but screen broke ;)
James Jackson-South
@JimBobSquarePants
Haha. Nice!
Tyler M
@TylerDM
@JimBobSquarePants Yeah I want to store the raw image without compression or encoding so it's ready to load from byte[] back into Image, be resized (or whatever else), and ship to the caller as a finished JPEG.
Tyler M
@TylerDM
One use case is I have employee portraits which come from AD. I want to call to AD to get the latest portrait. After that I want to hold onto the source image in memory. Later the website will request it at various sizes. The web API controller creates an Image, resizes it, and returns it. I could cache the Image object directly but I have a reusable caching mechanism which operates on streams (stored as byte[] from an ArrayPool).
James Jackson-South
@JimBobSquarePants
That sounds like a perfect use case for ImageSharp.Web
Anton Firsov
@antonfirsov
@TylerDM yeah should probably evaluate ImageSharp.Web